From 6037337b71fa88b545e1d0d23d6fe26920375dcf Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:51:50 +0000 Subject: [PATCH 1/2] SDK regeneration --- build.gradle | 11 +- gradle/wrapper/gradle-wrapper.jar | Bin 63721 -> 43453 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 +- gradlew.bat | 20 +- src/main/java/com/seam/api/Seam.java | 62 +- src/main/java/com/seam/api/SeamBuilder.java | 47 +- src/main/java/com/seam/api/core/ApiError.java | 28 - .../java/com/seam/api/core/ClientOptions.java | 24 +- .../java/com/seam/api/core/MediaTypes.java | 13 + .../com/seam/api/core/RequestOptions.java | 70 +- .../com/seam/api/core/RetryInterceptor.java | 10 +- .../com/seam/api/core/SeamApiApiError.java | 45 + .../java/com/seam/api/core/SeamApiError.java | 17 + src/main/java/com/seam/api/core/Stream.java | 97 + .../api/errors/SeamApiBadRequestError.java | 26 + .../api/errors/SeamApiUnauthorizedError.java | 26 + .../accesscodes/AccessCodesClient.java | 363 +++- .../AccessCodesCreateMultipleRequest.java | 195 +- .../requests/AccessCodesCreateRequest.java | 245 ++- .../requests/AccessCodesDeleteRequest.java | 20 +- .../AccessCodesGenerateCodeRequest.java | 101 + .../requests/AccessCodesGetRequest.java | 6 +- .../requests/AccessCodesListRequest.java | 57 +- ...ccessCodesPullBackupAccessCodeRequest.java | 12 +- .../requests/AccessCodesUpdateRequest.java | 283 ++- .../accesscodes/simulate/SimulateClient.java | 64 +- ...ulateCreateUnmanagedAccessCodeRequest.java | 16 +- ...lateCreateUnmanagedAccessCodeResponse.java | 31 +- ...RequestBehaviorWhenCodeCannotBeShared.java | 4 +- .../AccessCodesCreateMultipleResponse.java | 21 +- .../types/AccessCodesCreateResponse.java | 20 +- .../types/AccessCodesDeleteResponse.java | 17 +- .../AccessCodesGenerateCodeResponse.java | 125 ++ .../types/AccessCodesGetResponse.java | 17 +- .../types/AccessCodesListResponse.java | 21 +- ...cessCodesPullBackupAccessCodeResponse.java | 17 +- .../types/AccessCodesUpdateRequestType.java | 4 +- .../types/AccessCodesUpdateResponse.java | 17 +- .../unmanaged/UnmanagedClient.java | 245 ++- .../UnmanagedConvertToManagedRequest.java | 99 +- .../requests/UnmanagedDeleteRequest.java | 16 +- .../requests/UnmanagedGetRequest.java | 6 +- .../requests/UnmanagedListRequest.java | 51 +- .../requests/UnmanagedUpdateRequest.java | 102 +- .../UnmanagedConvertToManagedResponse.java | 14 +- .../types/UnmanagedDeleteResponse.java | 17 +- .../types/UnmanagedGetResponse.java | 30 +- .../types/UnmanagedListResponse.java | 143 ++ .../types/UnmanagedUpdateResponse.java | 101 + .../com/seam/api/resources/acs/AcsClient.java | 73 + .../acs/accessgroups/AccessGroupsClient.java | 319 +++ .../requests/AccessGroupsAddUserRequest.java | 124 ++ .../requests/AccessGroupsGetRequest.java | 101 + .../requests/AccessGroupsListRequest.java | 118 ++ .../AccessGroupsListUsersRequest.java | 101 + .../AccessGroupsRemoveUserRequest.java | 124 ++ .../types/AccessGroupsAddUserResponse.java | 101 + .../types/AccessGroupsGetResponse.java | 125 ++ .../types/AccessGroupsListResponse.java | 143 ++ .../types/AccessGroupsListUsersResponse.java | 143 ++ .../types/AccessGroupsRemoveUserResponse.java | 101 + .../CredentialPoolsClient.java | 89 + .../requests/CredentialPoolsListRequest.java | 101 + .../types/CredentialPoolsListResponse.java | 143 ++ ...edentialProvisioningAutomationsClient.java | 89 + ...lProvisioningAutomationsLaunchRequest.java | 231 +++ ...ProvisioningAutomationsLaunchResponse.java | 131 ++ .../acs/credentials/CredentialsClient.java | 486 +++++ .../requests/CredentialsAssignRequest.java | 124 ++ .../requests/CredentialsCreateRequest.java | 362 ++++ .../requests/CredentialsDeleteRequest.java | 101 + .../requests/CredentialsGetRequest.java | 101 + ...entialsListAccessibleEntrancesRequest.java | 103 + .../requests/CredentialsListRequest.java | 170 ++ .../requests/CredentialsUnassignRequest.java | 124 ++ .../requests/CredentialsUpdateRequest.java | 164 ++ .../types/CredentialsAssignResponse.java | 125 ++ .../CredentialsCreateRequestAccessMethod.java | 26 + ...ntialsCreateRequestVisionlineMetadata.java | 235 +++ ...teRequestVisionlineMetadataCardFormat.java | 24 + ...estVisionlineMetadataCardFunctionType.java | 24 + .../types/CredentialsCreateResponse.java | 125 ++ .../types/CredentialsDeleteResponse.java | 101 + .../types/CredentialsGetResponse.java | 124 ++ ...ntialsListAccessibleEntrancesResponse.java | 144 ++ .../types/CredentialsListResponse.java | 143 ++ .../types/CredentialsUnassignResponse.java | 125 ++ .../types/CredentialsUpdateResponse.java | 125 ++ .../acs/entrances/EntrancesClient.java | 265 +++ .../requests/EntrancesGetRequest.java | 101 + .../requests/EntrancesGrantAccessRequest.java | 124 ++ ...ancesListCredentialsWithAccessRequest.java | 134 ++ .../requests/EntrancesListRequest.java | 118 ++ .../entrances/types/EntrancesGetResponse.java | 124 ++ .../types/EntrancesGrantAccessResponse.java | 101 + ...ncesListCredentialsWithAccessResponse.java | 144 ++ .../types/EntrancesListResponse.java | 143 ++ .../resources/acs/systems/SystemsClient.java | 210 ++ .../systems/requests/SystemsGetRequest.java | 101 + ...bleCredentialManagerAcsSystemsRequest.java | 103 + .../systems/requests/SystemsListRequest.java} | 52 +- .../acs/systems/types/SystemsGetResponse.java | 124 ++ ...leCredentialManagerAcsSystemsResponse.java | 144 ++ .../systems/types/SystemsListResponse.java | 142 ++ .../api/resources/acs/users/UsersClient.java | 657 ++++++ .../UsersAddToAccessGroupRequest.java | 124 ++ .../users/requests/UsersCreateRequest.java | 334 +++ .../users/requests/UsersDeleteRequest.java | 101 + .../acs/users/requests/UsersGetRequest.java | 101 + .../UsersListAccessibleEntrancesRequest.java | 102 + .../acs/users/requests/UsersListRequest.java | 175 ++ .../UsersRemoveFromAccessGroupRequest.java | 124 ++ ...sersRevokeAccessToAllEntrancesRequest.java | 102 + .../users/requests/UsersSuspendRequest.java | 101 + .../users/requests/UsersUnsuspendRequest.java | 101 + .../users/requests/UsersUpdateRequest.java | 301 +++ .../types/UsersAddToAccessGroupResponse.java} | 34 +- .../UsersCreateRequestAccessSchedule.java | 125 ++ .../acs/users/types/UsersCreateResponse.java | 124 ++ .../acs/users/types/UsersDeleteResponse.java | 101 + .../acs/users/types/UsersGetResponse.java | 124 ++ .../UsersListAccessibleEntrancesResponse.java | 144 ++ .../acs/users/types/UsersListResponse.java | 142 ++ .../UsersRemoveFromAccessGroupResponse.java | 102 + ...ersRevokeAccessToAllEntrancesResponse.java | 102 + .../acs/users/types/UsersSuspendResponse.java | 101 + .../users/types/UsersUnsuspendResponse.java | 101 + .../UsersUpdateRequestAccessSchedule.java | 125 ++ .../acs/users/types/UsersUpdateResponse.java | 101 + .../actionattempts/ActionAttemptsClient.java | 94 +- .../requests/ActionAttemptsGetRequest.java | 12 +- .../requests/ActionAttemptsListRequest.java | 6 +- .../types/ActionAttemptsGetResponse.java | 17 +- .../types/ActionAttemptsListResponse.java | 21 +- .../clientsessions/ClientSessionsClient.java | 370 +++- .../requests/ClientSessionsCreateRequest.java | 71 +- .../requests/ClientSessionsDeleteRequest.java | 12 +- .../ClientSessionsGetOrCreateRequest.java | 206 ++ .../requests/ClientSessionsGetRequest.java | 6 +- .../ClientSessionsGrantAccessRequest.java | 205 ++ .../requests/ClientSessionsListRequest.java | 70 +- .../requests/ClientSessionsRevokeRequest.java | 101 + .../types/ClientSessionsCreateResponse.java | 17 +- .../types/ClientSessionsDeleteResponse.java | 14 +- .../ClientSessionsGetOrCreateResponse.java | 125 ++ .../types/ClientSessionsGetResponse.java | 17 +- .../ClientSessionsGrantAccessResponse.java | 125 ++ .../types/ClientSessionsListResponse.java | 21 +- .../types/ClientSessionsRevokeResponse.java | 101 + .../ConnectedAccountsClient.java | 211 +- .../ConnectedAccountsDeleteRequest.java | 51 +- .../ConnectedAccountsListRequest.java | 104 + .../ConnectedAccountsUpdateRequest.java | 172 ++ .../ConnectedAccountsDeleteResponse.java | 14 +- .../types/ConnectedAccountsGetRequest.java | 32 +- ...dAccountsGetRequestConnectedAccountId.java | 14 +- .../ConnectedAccountsGetRequestEmail.java | 14 +- .../types/ConnectedAccountsGetResponse.java | 17 +- ...untsListRequestCustomMetadataHasValue.java | 95 + .../types/ConnectedAccountsListResponse.java | 21 +- ...ountsUpdateRequestCustomMetadataValue.java | 95 + .../ConnectedAccountsUpdateResponse.java | 125 ++ .../ConnectWebviewsClient.java | 231 ++- .../ConnectWebviewsCreateRequest.java | 25 +- .../ConnectWebviewsDeleteRequest.java | 12 +- .../requests/ConnectWebviewsGetRequest.java | 12 +- .../requests/ConnectWebviewsListRequest.java | 152 ++ .../requests/ConnectWebviewsViewRequest.java | 124 -- .../types/AcceptedProvider.java | 100 + ...viewsCreateRequestCustomMetadataValue.java | 95 + .../types/ConnectWebviewsCreateResponse.java | 17 +- .../types/ConnectWebviewsDeleteResponse.java | 14 +- .../types/ConnectWebviewsGetResponse.java | 17 +- ...iewsListRequestCustomMetadataHasValue.java | 95 + .../types/ConnectWebviewsListResponse.java | 21 +- .../api/resources/devices/DevicesClient.java | 249 ++- .../requests/DevicesDeleteRequest.java | 12 +- .../devices/requests/DevicesGetRequest.java | 6 +- .../DevicesListDeviceProvidersRequest.java | 21 +- .../devices/requests/DevicesListRequest.java | 121 +- .../requests/DevicesUpdateRequest.java | 97 +- .../devices/simulate/SimulateClient.java | 195 ++ .../requests/SimulateConnectRequest.java | 101 + .../requests/SimulateDisconnectRequest.java | 101 + .../requests/SimulateRemoveRequest.java | 101 + .../types/SimulateConnectResponse.java} | 34 +- .../types/SimulateDisconnectResponse.java | 101 + .../types/SimulateRemoveResponse.java | 101 + .../devices}/types/DevicesDeleteResponse.java | 14 +- .../devices}/types/DevicesGetResponse.java | 17 +- .../DevicesListDeviceProvidersResponse.java | 59 +- ...icesListRequestCustomMetadataHasValue.java | 95 + .../DevicesListRequestExcludeIfItem.java | 34 + .../DevicesListRequestIncludeIfItem.java | 34 + .../devices}/types/DevicesListResponse.java | 21 +- ...vicesUpdateRequestCustomMetadataValue.java | 95 + .../types/DevicesUpdateRequestProperties.java | 8 +- .../devices}/types/DevicesUpdateResponse.java | 14 +- .../devices/unmanaged/UnmanagedClient.java | 167 +- .../requests/UnmanagedGetRequest.java | 118 ++ .../requests/UnmanagedListRequest.java | 121 +- .../requests/UnmanagedUpdateRequest.java | 14 +- .../unmanaged/types/UnmanagedGetResponse.java | 124 ++ ...agedListRequestCustomMetadataHasValue.java | 95 + .../UnmanagedListRequestExcludeIfItem.java | 34 + .../UnmanagedListRequestIncludeIfItem.java | 34 + .../types/UnmanagedListResponse.java | 21 +- .../types/UnmanagedUpdateResponse.java | 14 +- .../api/resources/events/EventsClient.java | 103 +- .../events/requests/EventsGetRequest.java | 6 +- .../events/requests/EventsListRequest.java | 65 +- .../events}/types/EventsGetResponse.java | 23 +- .../types/EventsListRequestBetweenItem.java | 10 +- .../events}/types/EventsListResponse.java | 78 +- .../api/resources/health/HealthClient.java | 104 - .../HealthGetServiceHealthRequest.java | 101 - .../health/service/ServiceClient.java | 64 - .../requests/ServiceByServiceNameRequest.java | 101 - .../seam/api/resources/locks/LocksClient.java | 178 +- .../locks/requests/LocksGetRequest.java | 6 +- .../locks/requests/LocksListRequest.java | 121 +- .../locks/requests/LocksLockDoorRequest.java | 16 +- .../requests/LocksUnlockDoorRequest.java | 16 +- .../locks}/types/LocksGetResponse.java | 66 +- ...ocksListRequestCustomMetadataHasValue.java | 95 + .../types/LocksListRequestExcludeIfItem.java | 34 + .../types/LocksListRequestIncludeIfItem.java | 34 + .../locks}/types/LocksListResponse.java | 55 +- .../locks}/types/LocksLockDoorResponse.java | 17 +- .../locks}/types/LocksUnlockDoorResponse.java | 17 +- .../resources/networks/NetworksClient.java | 150 ++ .../networks/requests/NetworksGetRequest.java | 101 + .../requests/NetworksListRequest.java | 59 + .../networks/types/NetworksGetResponse.java | 124 ++ .../networks/types/NetworksListResponse.java | 142 ++ .../NoiseThresholdsClient.java | 228 +- .../NoiseThresholdsCreateRequest.java | 32 +- .../NoiseThresholdsDeleteRequest.java | 18 +- .../requests/NoiseThresholdsGetRequest.java | 12 +- .../requests/NoiseThresholdsListRequest.java | 51 +- .../NoiseThresholdsUpdateRequest.java | 38 +- .../types/NoiseThresholdsCreateResponse.java | 153 ++ .../types/NoiseThresholdsDeleteResponse.java | 17 +- .../types/NoiseThresholdsGetResponse.java | 17 +- .../types/NoiseThresholdsListResponse.java | 21 +- .../types/NoiseThresholdsUpdateResponse.java | 17 +- .../noisesensors/simulate/SimulateClient.java | 57 +- .../SimulateTriggerNoiseThresholdRequest.java | 12 +- ...SimulateTriggerNoiseThresholdResponse.java | 14 +- .../api/resources/phones/PhonesClient.java | 158 ++ .../requests/PhonesDeactivateRequest.java | 101 + .../phones/requests/PhonesListRequest.java | 95 + .../phones/simulate/SimulateClient.java | 88 + .../SimulateCreateSandboxPhoneRequest.java | 200 ++ ...eSandboxPhoneRequestAssaAbloyMetadata.java | 231 +++ ...reateSandboxPhoneRequestPhoneMetadata.java | 172 ++ .../SimulateCreateSandboxPhoneResponse.java | 125 ++ .../types/PhonesDeactivateResponse.java | 101 + .../phones/types/PhonesListResponse.java | 142 ++ .../thermostats/ThermostatsClient.java | 421 +++- .../ClimateSettingSchedulesClient.java | 254 ++- .../ClimateSettingSchedulesCreateRequest.java | 75 +- .../ClimateSettingSchedulesDeleteRequest.java | 12 +- .../ClimateSettingSchedulesGetRequest.java | 6 +- .../ClimateSettingSchedulesListRequest.java | 51 +- .../ClimateSettingSchedulesUpdateRequest.java | 79 +- ...SchedulesCreateRequestHvacModeSetting.java | 28 + ...ClimateSettingSchedulesCreateResponse.java | 17 +- ...ClimateSettingSchedulesDeleteResponse.java | 14 +- .../ClimateSettingSchedulesGetResponse.java | 17 +- .../ClimateSettingSchedulesListResponse.java | 21 +- ...SchedulesUpdateRequestHvacModeSetting.java | 28 + ...ClimateSettingSchedulesUpdateResponse.java | 17 +- .../requests/ThermostatsCoolRequest.java | 196 ++ .../requests/ThermostatsGetRequest.java | 6 +- .../requests/ThermostatsHeatCoolRequest.java} | 262 ++- .../requests/ThermostatsHeatRequest.java | 24 +- .../requests/ThermostatsListRequest.java | 122 +- .../requests/ThermostatsOffRequest.java | 131 ++ .../ThermostatsSetFanModeRequest.java | 59 +- .../requests/ThermostatsUpdateRequest.java | 16 +- .../types/ThermostatsCoolResponse.java | 124 ++ .../types/ThermostatsGetResponse.java | 17 +- .../types/ThermostatsHeatCoolResponse.java | 125 ++ .../types/ThermostatsHeatResponse.java | 124 ++ ...tatsListRequestCustomMetadataHasValue.java | 95 + .../ThermostatsListRequestExcludeIfItem.java | 34 + .../ThermostatsListRequestIncludeIfItem.java | 34 + .../types/ThermostatsListResponse.java | 21 +- .../types/ThermostatsOffResponse.java | 124 ++ ...ostatsSetFanModeRequestFanModeSetting.java | 24 + .../types/ThermostatsSetFanModeResponse.java} | 37 +- ...atsUpdateRequestDefaultClimateSetting.java | 22 +- ...tDefaultClimateSettingHvacModeSetting.java | 28 + .../types/ThermostatsUpdateResponse.java | 14 +- .../useridentities/UserIdentitiesClient.java | 736 +++++++ .../EnrollmentAutomationsClient.java | 262 +++ .../EnrollmentAutomationsDeleteRequest.java | 103 + .../EnrollmentAutomationsGetRequest.java | 101 + .../EnrollmentAutomationsLaunchRequest.java | 231 +++ .../EnrollmentAutomationsListRequest.java | 101 + .../EnrollmentAutomationsDeleteResponse.java | 102 + .../EnrollmentAutomationsGetResponse.java | 125 ++ .../EnrollmentAutomationsLaunchResponse.java | 128 ++ ...onsLaunchResponseEnrollmentAutomation.java | 247 +++ .../EnrollmentAutomationsListResponse.java | 143 ++ .../UserIdentitiesAddAcsUserRequest.java | 124 ++ .../requests/UserIdentitiesCreateRequest.java | 170 ++ .../requests/UserIdentitiesDeleteRequest.java | 101 + ...rIdentitiesGrantAccessToDeviceRequest.java | 125 ++ ...dentitiesListAccessibleDevicesRequest.java | 103 + .../UserIdentitiesListAcsSystemsRequest.java | 102 + .../UserIdentitiesListAcsUsersRequest.java | 101 + .../requests/UserIdentitiesListRequest.java | 96 + .../UserIdentitiesRemoveAcsUserRequest.java | 125 ++ ...IdentitiesRevokeAccessToDeviceRequest.java | 125 ++ .../requests/UserIdentitiesUpdateRequest.java | 227 ++ .../UserIdentitiesAddAcsUserResponse.java | 101 + .../types/UserIdentitiesCreateResponse.java | 125 ++ .../types/UserIdentitiesDeleteResponse.java | 101 + .../types/UserIdentitiesGetRequest.java | 94 + ...serIdentitiesGetRequestUserIdentityId.java | 102 + ...erIdentitiesGetRequestUserIdentityKey.java | 102 + .../types/UserIdentitiesGetResponse.java | 124 ++ ...IdentitiesGrantAccessToDeviceResponse.java | 102 + ...entitiesListAccessibleDevicesResponse.java | 185 ++ .../UserIdentitiesListAcsSystemsResponse.java | 144 ++ .../UserIdentitiesListAcsUsersResponse.java | 144 ++ .../types/UserIdentitiesListResponse.java | 143 ++ .../UserIdentitiesRemoveAcsUserResponse.java | 102 + ...dentitiesRevokeAccessToDeviceResponse.java | 102 + .../types/UserIdentitiesUpdateResponse.java | 101 + .../resources/webhooks/WebhooksClient.java | 249 ++- .../requests/WebhooksCreateRequest.java | 16 +- .../requests/WebhooksDeleteRequest.java | 12 +- .../webhooks/requests/WebhooksGetRequest.java | 12 +- .../requests/WebhooksUpdateRequest.java | 141 ++ .../types/WebhooksCreateResponse.java | 17 +- .../types/WebhooksDeleteResponse.java | 14 +- .../webhooks}/types/WebhooksGetResponse.java | 17 +- .../webhooks}/types/WebhooksListResponse.java | 21 +- .../types/WebhooksUpdateResponse.java | 101 + .../workspaces/WorkspacesClient.java | 182 +- .../requests/WorkspacesCreateRequest.java | 269 +++ .../workspaces/types/WebviewLogoShape.java | 24 + .../types/WorkspacesCreateResponse.java | 124 ++ .../types/WorkspacesGetResponse.java | 63 +- .../types/WorkspacesListResponse.java | 21 +- .../types/WorkspacesResetSandboxResponse.java | 54 +- .../java/com/seam/api/types/AccessCode.java | 290 ++- .../com/seam/api/types/AccessCodeStatus.java | 2 +- .../com/seam/api/types/AccessCodeType.java | 2 +- .../com/seam/api/types/AcsAccessGroup.java | 352 ++++ .../types/AcsAccessGroupAccessGroupType.java | 28 + .../api/types/AcsAccessGroupExternalType.java | 28 + .../com/seam/api/types/AcsCredential.java | 718 +++++++ ...pe.java => AcsCredentialAccessMethod.java} | 12 +- .../api/types/AcsCredentialErrorsItem.java | 123 ++ .../api/types/AcsCredentialExternalType.java | 28 + .../com/seam/api/types/AcsCredentialPool.java | 249 +++ .../AcsCredentialProvisioningAutomation.java | 220 ++ .../AcsCredentialVisionlineMetadata.java | 205 ++ ...alVisionlineMetadataCardFunctionType.java} | 10 +- .../api/types/AcsCredentialWarningsItem.java | 123 ++ .../java/com/seam/api/types/AcsEntrance.java | 295 +++ .../seam/api/types/AcsEntranceErrorsItem.java | 123 ++ .../api/types/AcsEntranceLatchMetadata.java | 177 ++ .../types/AcsEntranceVisionlineMetadata.java | 160 ++ ...ntranceVisionlineMetadataDoorCategory.java | 30 + ...ntranceVisionlineMetadataProfilesItem.java | 132 ++ ...ProfilesItemVisionlineDoorProfileType.java | 26 + .../java/com/seam/api/types/AcsSystem.java | 628 ++++++ .../seam/api/types/AcsSystemErrorsItem.java | 210 ++ ...ystemErrorsItemSeamBridgeDisconnected.java | 126 ++ ...rorsItemVisionlineInstanceUnreachable.java | 126 ++ .../seam/api/types/AcsSystemExternalType.java | 36 + .../seam/api/types/AcsSystemSystemType.java | 36 + .../seam/api/types/AcsSystemWarningsItem.java | 59 + src/main/java/com/seam/api/types/AcsUser.java | 630 ++++++ .../seam/api/types/AcsUserAccessSchedule.java | 125 ++ .../seam/api/types/AcsUserExternalType.java | 30 + .../com/seam/api/types/ActionAttempt.java | 699 +++++-- .../types/ActionAttemptActionAttemptId.java | 168 ++ .../ActionAttemptActionAttemptIdError.java | 123 ++ .../seam/api/types/ActionAttemptEight.java | 168 ++ ...rror.java => ActionAttemptEightError.java} | 34 +- .../seam/api/types/ActionAttemptEighteen.java | 165 ++ .../seam/api/types/ActionAttemptEleven.java | 168 ++ .../api/types/ActionAttemptElevenError.java | 123 ++ .../seam/api/types/ActionAttemptFifteen.java | 165 ++ .../com/seam/api/types/ActionAttemptFive.java | 168 ++ .../api/types/ActionAttemptFiveError.java | 123 ++ ...emptError.java => ActionAttemptForty.java} | 130 +- .../seam/api/types/ActionAttemptFortyOne.java | 168 ++ .../api/types/ActionAttemptFortyOneError.java | 123 ++ .../api/types/ActionAttemptFortyThree.java | 173 ++ .../seam/api/types/ActionAttemptFortyTwo.java | 165 ++ .../com/seam/api/types/ActionAttemptFour.java | 168 ++ .../api/types/ActionAttemptFourResult.java | 59 + .../seam/api/types/ActionAttemptFourteen.java | 168 ++ .../api/types/ActionAttemptFourteenError.java | 123 ++ .../com/seam/api/types/ActionAttemptNine.java | 165 ++ .../seam/api/types/ActionAttemptNineteen.java | 168 ++ .../types/ActionAttemptNineteenResult.java | 59 + .../com/seam/api/types/ActionAttemptOne.java | 168 ++ .../api/types/ActionAttemptOneResult.java | 59 + .../seam/api/types/ActionAttemptPending.java | 189 -- .../seam/api/types/ActionAttemptSeven.java | 168 ++ .../api/types/ActionAttemptSevenResult.java | 59 + .../api/types/ActionAttemptSeventeen.java | 168 ++ .../types/ActionAttemptSeventeenError.java | 123 ++ .../com/seam/api/types/ActionAttemptSix.java | 165 ++ .../seam/api/types/ActionAttemptSixteen.java | 168 ++ .../api/types/ActionAttemptSixteenResult.java | 59 + .../com/seam/api/types/ActionAttemptTen.java | 168 ++ .../api/types/ActionAttemptTenResult.java | 59 + .../seam/api/types/ActionAttemptThirteen.java | 168 ++ .../types/ActionAttemptThirteenResult.java | 59 + .../seam/api/types/ActionAttemptThirty.java | 165 ++ .../api/types/ActionAttemptThirtyEight.java | 168 ++ .../types/ActionAttemptThirtyEightError.java | 123 ++ .../api/types/ActionAttemptThirtyFive.java | 168 ++ .../types/ActionAttemptThirtyFiveError.java | 123 ++ .../api/types/ActionAttemptThirtyFour.java | 173 ++ .../api/types/ActionAttemptThirtyNine.java | 165 ++ ...ccess.java => ActionAttemptThirtyOne.java} | 134 +- .../api/types/ActionAttemptThirtySeven.java | 173 ++ .../api/types/ActionAttemptThirtySix.java | 165 ++ .../api/types/ActionAttemptThirtyThree.java | 165 ++ .../api/types/ActionAttemptThirtyTwo.java | 168 ++ .../types/ActionAttemptThirtyTwoError.java | 123 ++ .../seam/api/types/ActionAttemptThree.java | 165 ++ .../seam/api/types/ActionAttemptTwelve.java | 165 ++ .../seam/api/types/ActionAttemptTwenty.java | 168 ++ .../api/types/ActionAttemptTwentyEight.java | 173 ++ .../api/types/ActionAttemptTwentyError.java | 123 ++ .../api/types/ActionAttemptTwentyFive.java | 173 ++ .../api/types/ActionAttemptTwentyFour.java | 165 ++ .../api/types/ActionAttemptTwentyNine.java | 168 ++ .../types/ActionAttemptTwentyNineError.java | 123 ++ .../api/types/ActionAttemptTwentyOne.java | 165 ++ .../api/types/ActionAttemptTwentySeven.java | 165 ++ .../api/types/ActionAttemptTwentySix.java | 168 ++ .../types/ActionAttemptTwentySixError.java | 123 ++ .../api/types/ActionAttemptTwentyThree.java | 168 ++ .../types/ActionAttemptTwentyThreeError.java | 123 ++ .../api/types/ActionAttemptTwentyTwo.java | 168 ++ .../types/ActionAttemptTwentyTwoResult.java | 59 + .../com/seam/api/types/ActionAttemptTwo.java | 168 ++ .../seam/api/types/ActionAttemptTwoError.java | 123 ++ .../com/seam/api/types/ActionAttemptZero.java | 165 ++ .../com/seam/api/types/ClientSession.java | 143 +- .../api/types/ClimateSettingSchedule.java | 104 +- ...ClimateSettingScheduleHvacModeSetting.java | 28 + .../com/seam/api/types/ConnectWebview.java | 422 +++- ...=> ConnectWebviewCustomMetadataValue.java} | 52 +- .../seam/api/types/ConnectWebviewStatus.java | 2 +- .../com/seam/api/types/ConnectedAccount.java | 212 +- .../ConnectedAccountCustomMetadataValue.java | 35 +- .../types/ConnectedAccountUserIdentifier.java | 6 +- src/main/java/com/seam/api/types/Device.java | 498 ++++- .../DeviceCapabilitiesSupportedItem.java | 6 +- .../api/types/DeviceCustomMetadataValue.java | 93 + .../com/seam/api/types/DeviceErrorsItem.java | 14 +- .../seam/api/types/DeviceListProvider.java | 184 -- .../com/seam/api/types/DeviceLocation.java | 124 ++ .../com/seam/api/types/DeviceProperties.java | 1844 ++++++++++++++++- .../DevicePropertiesAccessoryKeypad.java | 148 ++ ...evicePropertiesAccessoryKeypadBattery.java | 102 + .../api/types/DevicePropertiesAppearance.java | 108 + ...iesAssaAbloyCredentialServiceMetadata.java | 147 ++ ...redentialServiceMetadataEndpointsItem.java | 126 ++ ...va => DevicePropertiesAugustMetadata.java} | 126 +- .../DevicePropertiesAvigilonAltaMetadata.java | 271 +++ .../api/types/DevicePropertiesBattery.java | 124 ++ .../types/DevicePropertiesBatteryStatus.java | 28 + .../types/DevicePropertiesBrivoMetadata.java | 101 + .../DevicePropertiesCodeConstraintsItem.java | 97 + ...ropertiesCodeConstraintsItemMaxLength.java | 167 ++ ...onstraintsItemMaxLengthConstraintType.java | 24 + ...vicePropertiesCodeConstraintsItemZero.java | 104 + ...CodeConstraintsItemZeroConstraintType.java | 38 + .../DevicePropertiesControlbywebMetadata.java | 157 ++ ...icePropertiesDormakabaOracodeMetadata.java | 316 +++ ...racodeMetadataPredefinedTimeSlotsItem.java | 353 ++++ .../types/DevicePropertiesEcobeeMetadata.java | 124 ++ .../DevicePropertiesFourSuitesMetadata.java | 154 ++ .../types/DevicePropertiesGenieMetadata.java | 124 ++ ...icePropertiesHoneywellResideoMetadata.java | 126 ++ .../DevicePropertiesHubitatMetadata.java | 148 ++ .../types/DevicePropertiesIglooMetadata.java | 154 ++ .../DevicePropertiesIgloohomeMetadata.java | 220 ++ .../types/DevicePropertiesKeypadBattery.java | 101 + .../DevicePropertiesKwiksetMetadata.java | 148 ++ .../types/DevicePropertiesLocklyMetadata.java | 154 ++ .../types/DevicePropertiesMinutMetadata.java | 151 ++ ...ertiesMinutMetadataLatestSensorValues.java | 203 ++ ...adataLatestSensorValuesAccelerometerZ.java | 125 ++ ...nutMetadataLatestSensorValuesHumidity.java | 125 ++ ...nutMetadataLatestSensorValuesPressure.java | 125 ++ ...sMinutMetadataLatestSensorValuesSound.java | 125 ++ ...MetadataLatestSensorValuesTemperature.java | 125 ++ .../seam/api/types/DevicePropertiesModel.java | 261 ++- .../types/DevicePropertiesNestMetadata.java | 148 ++ .../DevicePropertiesNoiseawareMetadata.java | 208 ++ ...opertiesNoiseawareMetadataDeviceModel.java | 24 + .../types/DevicePropertiesNukiMetadata.java | 221 ++ .../types/DevicePropertiesSaltoMetadata.java | 239 +++ .../DevicePropertiesSchlageMetadata.java | 190 ++ .../DevicePropertiesSeamBridgeMetadata.java | 158 ++ ...pertiesSeamBridgeMetadataUnlockMethod.java | 24 + ... DevicePropertiesSmartthingsMetadata.java} | 77 +- .../types/DevicePropertiesTedeeMetadata.java | 277 +++ .../types/DevicePropertiesTtlockMetadata.java | 146 ++ .../types/DevicePropertiesTwoNMetadata.java | 123 ++ .../types/DevicePropertiesWyzeMetadata.java | 309 +++ ...ProvidersItem.java => DeviceProvider.java} | 82 +- ... => DeviceProviderDeviceProviderName.java} | 28 +- ...DeviceProviderProviderCategoriesItem.java} | 14 +- .../java/com/seam/api/types/DeviceType.java | 16 +- .../seam/api/types/DeviceWarningsItem.java | 14 +- .../types/DevicesUpdateRequestLocation.java | 32 - .../seam/api/types/EnrollmentAutomation.java | 217 ++ src/main/java/com/seam/api/types/Event.java | 232 ++- ...uestEventTypesItem.java => EventType.java} | 42 +- .../api/types/EventsListRequestEventType.java | 84 - src/main/java/com/seam/api/types/FanMode.java | 24 + .../com/seam/api/types/FanModeSetting.java | 2 +- .../api/types/HealthGetHealthResponse.java | 182 -- .../types/HealthGetServiceHealthResponse.java | 152 -- .../com/seam/api/types/HvacModeSetting.java | 2 +- .../java/com/seam/api/types/Manufacturer.java | 16 +- .../com/seam/api/types/MaxTimeRounding.java | 28 + src/main/java/com/seam/api/types/Network.java | 177 ++ .../com/seam/api/types/NoiseThreshold.java | 26 +- src/main/java/com/seam/api/types/Phone.java | 810 ++++++++ ...va => PhoneCapabilitiesSupportedItem.java} | 10 +- .../api/types/PhoneCustomMetadataValue.java | 93 + .../com/seam/api/types/PhoneDeviceType.java | 24 + .../com/seam/api/types/PhoneErrorsItem.java | 123 ++ .../com/seam/api/types/PhoneLocation.java | 124 ++ .../seam/api/types/PhoneOperatingSystem.java | 24 + .../com/seam/api/types/PhoneProperties.java | 100 + ...iesAssaAbloyCredentialServiceMetadata.java | 147 ++ ...redentialServiceMetadataEndpointsItem.java | 126 ++ .../com/seam/api/types/PhoneWarningsItem.java | 123 ++ .../com/seam/api/types/ProviderCategory.java | 6 +- .../com/seam/api/types/SelectionMode.java | 2 +- .../types/ServiceByServiceNameResponse.java | 152 -- .../com/seam/api/types/ServiceHealth.java | 16 +- .../seam/api/types/ServiceHealthStatus.java | 2 +- ...UnmanagedAccessCodeResponseAccessCode.java | 202 -- ...edAccessCodeResponseAccessCodeOngoing.java | 250 --- ...odeResponseAccessCodeOngoingCreatedAt.java | 98 - ...AccessCodeResponseAccessCodeTimeBound.java | 251 --- ...eResponseAccessCodeTimeBoundCreatedAt.java | 98 - ...cessCode.java => UnmanagedAccessCode.java} | 132 +- ...Type.java => UnmanagedAccessCodeType.java} | 6 +- .../com/seam/api/types/UnmanagedDevice.java | 392 +++- ...anagedDeviceCapabilitiesSupportedItem.java | 32 + .../types/UnmanagedDeviceDeviceProvider.java | 96 + .../api/types/UnmanagedDeviceErrorsItem.java | 14 +- .../api/types/UnmanagedDeviceProperties.java | 276 ++- ...anagedDevicePropertiesAccessoryKeypad.java | 149 ++ ...evicePropertiesAccessoryKeypadBattery.java | 102 + .../UnmanagedDevicePropertiesBattery.java | 124 ++ ...nmanagedDevicePropertiesBatteryStatus.java | 28 + .../types/UnmanagedDevicePropertiesModel.java | 261 ++- .../types/UnmanagedDeviceWarningsItem.java | 14 +- .../UnmanagedListResponseAccessCodesItem.java | 412 ---- .../java/com/seam/api/types/UserIdentity.java | 316 +++ src/main/java/com/seam/api/types/Webhook.java | 22 +- .../java/com/seam/api/types/Workspace.java | 55 +- 574 files changed, 60743 insertions(+), 6491 deletions(-) delete mode 100644 src/main/java/com/seam/api/core/ApiError.java create mode 100644 src/main/java/com/seam/api/core/MediaTypes.java create mode 100644 src/main/java/com/seam/api/core/SeamApiApiError.java create mode 100644 src/main/java/com/seam/api/core/SeamApiError.java create mode 100644 src/main/java/com/seam/api/core/Stream.java create mode 100644 src/main/java/com/seam/api/errors/SeamApiBadRequestError.java create mode 100644 src/main/java/com/seam/api/errors/SeamApiUnauthorizedError.java create mode 100644 src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGenerateCodeRequest.java rename src/main/java/com/seam/api/{ => resources/accesscodes/simulate}/types/SimulateCreateUnmanagedAccessCodeResponse.java (81%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared.java (87%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesCreateMultipleResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesCreateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesDeleteResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesGenerateCodeResponse.java rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesGetResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesListResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesPullBackupAccessCodeResponse.java (93%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesUpdateRequestType.java (85%) rename src/main/java/com/seam/api/{ => resources/accesscodes}/types/AccessCodesUpdateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/accesscodes/unmanaged}/types/UnmanagedConvertToManagedResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/accesscodes/unmanaged}/types/UnmanagedDeleteResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/accesscodes/unmanaged}/types/UnmanagedGetResponse.java (80%) create mode 100644 src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedListResponse.java create mode 100644 src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedUpdateResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/AcsClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/AccessGroupsClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsAddUserRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListUsersRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsRemoveUserRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsAddUserResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListUsersResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsRemoveUserResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentialpools/CredentialPoolsClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentialpools/requests/CredentialPoolsListRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentialpools/types/CredentialPoolsListResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/CredentialProvisioningAutomationsClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/requests/CredentialProvisioningAutomationsLaunchRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/types/CredentialProvisioningAutomationsLaunchResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/CredentialsClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsAssignRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsCreateRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsDeleteRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListAccessibleEntrancesRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUnassignRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUpdateRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsAssignResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestAccessMethod.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadata.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFormat.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFunctionType.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsDeleteResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListAccessibleEntrancesResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUnassignResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUpdateResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/EntrancesClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGrantAccessRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListCredentialsWithAccessRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGrantAccessResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListCredentialsWithAccessResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/systems/SystemsClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/systems/requests/SystemsGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/systems/requests/SystemsListCompatibleCredentialManagerAcsSystemsRequest.java rename src/main/java/com/seam/api/{types/NukiDeviceMetadata.java => resources/acs/systems/requests/SystemsListRequest.java} (50%) create mode 100644 src/main/java/com/seam/api/resources/acs/systems/types/SystemsGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/systems/types/SystemsListCompatibleCredentialManagerAcsSystemsResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/systems/types/SystemsListResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/UsersClient.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersAddToAccessGroupRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersCreateRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersDeleteRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersListAccessibleEntrancesRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersListRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersRemoveFromAccessGroupRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersRevokeAccessToAllEntrancesRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersSuspendRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersUnsuspendRequest.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/requests/UsersUpdateRequest.java rename src/main/java/com/seam/api/{types/ThermostatsSetFanModeResponse.java => resources/acs/users/types/UsersAddToAccessGroupResponse.java} (70%) create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersCreateRequestAccessSchedule.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersCreateResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersDeleteResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersListAccessibleEntrancesResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersListResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersRemoveFromAccessGroupResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersRevokeAccessToAllEntrancesResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersSuspendResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersUnsuspendResponse.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateRequestAccessSchedule.java create mode 100644 src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateResponse.java rename src/main/java/com/seam/api/{ => resources/actionattempts}/types/ActionAttemptsGetResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/actionattempts}/types/ActionAttemptsListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetOrCreateRequest.java create mode 100644 src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGrantAccessRequest.java create mode 100644 src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsRevokeRequest.java rename src/main/java/com/seam/api/{ => resources/clientsessions}/types/ClientSessionsCreateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/clientsessions}/types/ClientSessionsDeleteResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGetOrCreateResponse.java rename src/main/java/com/seam/api/{ => resources/clientsessions}/types/ClientSessionsGetResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGrantAccessResponse.java rename src/main/java/com/seam/api/{ => resources/clientsessions}/types/ClientSessionsListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsRevokeResponse.java create mode 100644 src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsListRequest.java create mode 100644 src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsUpdateRequest.java rename src/main/java/com/seam/api/{ => resources/connectedaccounts}/types/ConnectedAccountsDeleteResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/connectedaccounts}/types/ConnectedAccountsGetRequest.java (72%) rename src/main/java/com/seam/api/{ => resources/connectedaccounts}/types/ConnectedAccountsGetRequestConnectedAccountId.java (93%) rename src/main/java/com/seam/api/{ => resources/connectedaccounts}/types/ConnectedAccountsGetRequestEmail.java (92%) rename src/main/java/com/seam/api/{ => resources/connectedaccounts}/types/ConnectedAccountsGetResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsListRequestCustomMetadataHasValue.java rename src/main/java/com/seam/api/{ => resources/connectedaccounts}/types/ConnectedAccountsListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateRequestCustomMetadataValue.java create mode 100644 src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateResponse.java create mode 100644 src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsListRequest.java delete mode 100644 src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsViewRequest.java create mode 100644 src/main/java/com/seam/api/resources/connectwebviews/types/AcceptedProvider.java create mode 100644 src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsCreateRequestCustomMetadataValue.java rename src/main/java/com/seam/api/{ => resources/connectwebviews}/types/ConnectWebviewsCreateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/connectwebviews}/types/ConnectWebviewsDeleteResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/connectwebviews}/types/ConnectWebviewsGetResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsListRequestCustomMetadataHasValue.java rename src/main/java/com/seam/api/{ => resources/connectwebviews}/types/ConnectWebviewsListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/devices/simulate/SimulateClient.java create mode 100644 src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateConnectRequest.java create mode 100644 src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateDisconnectRequest.java create mode 100644 src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateRemoveRequest.java rename src/main/java/com/seam/api/{types/ThermostatsHeatResponse.java => resources/devices/simulate/types/SimulateConnectResponse.java} (71%) create mode 100644 src/main/java/com/seam/api/resources/devices/simulate/types/SimulateDisconnectResponse.java create mode 100644 src/main/java/com/seam/api/resources/devices/simulate/types/SimulateRemoveResponse.java rename src/main/java/com/seam/api/{ => resources/devices}/types/DevicesDeleteResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/devices}/types/DevicesGetResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/devices}/types/DevicesListDeviceProvidersResponse.java (63%) create mode 100644 src/main/java/com/seam/api/resources/devices/types/DevicesListRequestCustomMetadataHasValue.java create mode 100644 src/main/java/com/seam/api/resources/devices/types/DevicesListRequestExcludeIfItem.java create mode 100644 src/main/java/com/seam/api/resources/devices/types/DevicesListRequestIncludeIfItem.java rename src/main/java/com/seam/api/{ => resources/devices}/types/DevicesListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/devices/types/DevicesUpdateRequestCustomMetadataValue.java rename src/main/java/com/seam/api/{ => resources/devices}/types/DevicesUpdateRequestProperties.java (95%) rename src/main/java/com/seam/api/{ => resources/devices}/types/DevicesUpdateResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestCustomMetadataHasValue.java create mode 100644 src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestExcludeIfItem.java create mode 100644 src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestIncludeIfItem.java rename src/main/java/com/seam/api/{ => resources/devices/unmanaged}/types/UnmanagedListResponse.java (91%) rename src/main/java/com/seam/api/{ => resources/devices/unmanaged}/types/UnmanagedUpdateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/events}/types/EventsGetResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/events}/types/EventsListRequestBetweenItem.java (95%) rename src/main/java/com/seam/api/{ => resources/events}/types/EventsListResponse.java (62%) delete mode 100644 src/main/java/com/seam/api/resources/health/HealthClient.java delete mode 100644 src/main/java/com/seam/api/resources/health/requests/HealthGetServiceHealthRequest.java delete mode 100644 src/main/java/com/seam/api/resources/health/service/ServiceClient.java delete mode 100644 src/main/java/com/seam/api/resources/health/service/requests/ServiceByServiceNameRequest.java rename src/main/java/com/seam/api/{ => resources/locks}/types/LocksGetResponse.java (75%) create mode 100644 src/main/java/com/seam/api/resources/locks/types/LocksListRequestCustomMetadataHasValue.java create mode 100644 src/main/java/com/seam/api/resources/locks/types/LocksListRequestExcludeIfItem.java create mode 100644 src/main/java/com/seam/api/resources/locks/types/LocksListRequestIncludeIfItem.java rename src/main/java/com/seam/api/{ => resources/locks}/types/LocksListResponse.java (77%) rename src/main/java/com/seam/api/{ => resources/locks}/types/LocksLockDoorResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/locks}/types/LocksUnlockDoorResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/networks/NetworksClient.java create mode 100644 src/main/java/com/seam/api/resources/networks/requests/NetworksGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/networks/requests/NetworksListRequest.java create mode 100644 src/main/java/com/seam/api/resources/networks/types/NetworksGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/networks/types/NetworksListResponse.java create mode 100644 src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsCreateResponse.java rename src/main/java/com/seam/api/{ => resources/noisesensors/noisethresholds}/types/NoiseThresholdsDeleteResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/noisesensors/noisethresholds}/types/NoiseThresholdsGetResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/noisesensors/noisethresholds}/types/NoiseThresholdsListResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/noisesensors/noisethresholds}/types/NoiseThresholdsUpdateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/noisesensors/simulate}/types/SimulateTriggerNoiseThresholdResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/phones/PhonesClient.java create mode 100644 src/main/java/com/seam/api/resources/phones/requests/PhonesDeactivateRequest.java create mode 100644 src/main/java/com/seam/api/resources/phones/requests/PhonesListRequest.java create mode 100644 src/main/java/com/seam/api/resources/phones/simulate/SimulateClient.java create mode 100644 src/main/java/com/seam/api/resources/phones/simulate/requests/SimulateCreateSandboxPhoneRequest.java create mode 100644 src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestAssaAbloyMetadata.java create mode 100644 src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestPhoneMetadata.java create mode 100644 src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneResponse.java create mode 100644 src/main/java/com/seam/api/resources/phones/types/PhonesDeactivateResponse.java create mode 100644 src/main/java/com/seam/api/resources/phones/types/PhonesListResponse.java create mode 100644 src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesCreateRequestHvacModeSetting.java rename src/main/java/com/seam/api/{ => resources/thermostats/climatesettingschedules}/types/ClimateSettingSchedulesCreateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/thermostats/climatesettingschedules}/types/ClimateSettingSchedulesDeleteResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/thermostats/climatesettingschedules}/types/ClimateSettingSchedulesGetResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/thermostats/climatesettingschedules}/types/ClimateSettingSchedulesListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesUpdateRequestHvacModeSetting.java rename src/main/java/com/seam/api/{ => resources/thermostats/climatesettingschedules}/types/ClimateSettingSchedulesUpdateResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsCoolRequest.java rename src/main/java/com/seam/api/{types/CurrentClimateSetting.java => resources/thermostats/requests/ThermostatsHeatCoolRequest.java} (50%) create mode 100644 src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsOffRequest.java create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsCoolResponse.java rename src/main/java/com/seam/api/{ => resources/thermostats}/types/ThermostatsGetResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatCoolResponse.java create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatResponse.java create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestCustomMetadataHasValue.java create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestExcludeIfItem.java create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestIncludeIfItem.java rename src/main/java/com/seam/api/{ => resources/thermostats}/types/ThermostatsListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsOffResponse.java create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsSetFanModeRequestFanModeSetting.java rename src/main/java/com/seam/api/{types/NoiseThresholdsCreateResponse.java => resources/thermostats/types/ThermostatsSetFanModeResponse.java} (75%) rename src/main/java/com/seam/api/{ => resources/thermostats}/types/ThermostatsUpdateRequestDefaultClimateSetting.java (92%) create mode 100644 src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting.java rename src/main/java/com/seam/api/{ => resources/thermostats}/types/ThermostatsUpdateResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/useridentities/UserIdentitiesClient.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/EnrollmentAutomationsClient.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsDeleteRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsLaunchRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsListRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsDeleteResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponseEnrollmentAutomation.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsListResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesAddAcsUserRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesCreateRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesDeleteRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesGrantAccessToDeviceRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAccessibleDevicesRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsSystemsRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsUsersRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRemoveAcsUserRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRevokeAccessToDeviceRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesUpdateRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesAddAcsUserResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesCreateResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesDeleteResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequest.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityId.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityKey.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGrantAccessToDeviceResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAccessibleDevicesResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsSystemsResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsUsersResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRemoveAcsUserResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRevokeAccessToDeviceResponse.java create mode 100644 src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesUpdateResponse.java create mode 100644 src/main/java/com/seam/api/resources/webhooks/requests/WebhooksUpdateRequest.java rename src/main/java/com/seam/api/{ => resources/webhooks}/types/WebhooksCreateResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/webhooks}/types/WebhooksDeleteResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/webhooks}/types/WebhooksGetResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/webhooks}/types/WebhooksListResponse.java (92%) create mode 100644 src/main/java/com/seam/api/resources/webhooks/types/WebhooksUpdateResponse.java create mode 100644 src/main/java/com/seam/api/resources/workspaces/requests/WorkspacesCreateRequest.java create mode 100644 src/main/java/com/seam/api/resources/workspaces/types/WebviewLogoShape.java create mode 100644 src/main/java/com/seam/api/resources/workspaces/types/WorkspacesCreateResponse.java rename src/main/java/com/seam/api/{ => resources/workspaces}/types/WorkspacesGetResponse.java (72%) rename src/main/java/com/seam/api/{ => resources/workspaces}/types/WorkspacesListResponse.java (92%) rename src/main/java/com/seam/api/{ => resources/workspaces}/types/WorkspacesResetSandboxResponse.java (64%) create mode 100644 src/main/java/com/seam/api/types/AcsAccessGroup.java create mode 100644 src/main/java/com/seam/api/types/AcsAccessGroupAccessGroupType.java create mode 100644 src/main/java/com/seam/api/types/AcsAccessGroupExternalType.java create mode 100644 src/main/java/com/seam/api/types/AcsCredential.java rename src/main/java/com/seam/api/types/{UnmanagedListResponseAccessCodesItemType.java => AcsCredentialAccessMethod.java} (62%) create mode 100644 src/main/java/com/seam/api/types/AcsCredentialErrorsItem.java create mode 100644 src/main/java/com/seam/api/types/AcsCredentialExternalType.java create mode 100644 src/main/java/com/seam/api/types/AcsCredentialPool.java create mode 100644 src/main/java/com/seam/api/types/AcsCredentialProvisioningAutomation.java create mode 100644 src/main/java/com/seam/api/types/AcsCredentialVisionlineMetadata.java rename src/main/java/com/seam/api/types/{DevicesListDeviceProvidersRequestProviderCategory.java => AcsCredentialVisionlineMetadataCardFunctionType.java} (58%) create mode 100644 src/main/java/com/seam/api/types/AcsCredentialWarningsItem.java create mode 100644 src/main/java/com/seam/api/types/AcsEntrance.java create mode 100644 src/main/java/com/seam/api/types/AcsEntranceErrorsItem.java create mode 100644 src/main/java/com/seam/api/types/AcsEntranceLatchMetadata.java create mode 100644 src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadata.java create mode 100644 src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataDoorCategory.java create mode 100644 src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItem.java create mode 100644 src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType.java create mode 100644 src/main/java/com/seam/api/types/AcsSystem.java create mode 100644 src/main/java/com/seam/api/types/AcsSystemErrorsItem.java create mode 100644 src/main/java/com/seam/api/types/AcsSystemErrorsItemSeamBridgeDisconnected.java create mode 100644 src/main/java/com/seam/api/types/AcsSystemErrorsItemVisionlineInstanceUnreachable.java create mode 100644 src/main/java/com/seam/api/types/AcsSystemExternalType.java create mode 100644 src/main/java/com/seam/api/types/AcsSystemSystemType.java create mode 100644 src/main/java/com/seam/api/types/AcsSystemWarningsItem.java create mode 100644 src/main/java/com/seam/api/types/AcsUser.java create mode 100644 src/main/java/com/seam/api/types/AcsUserAccessSchedule.java create mode 100644 src/main/java/com/seam/api/types/AcsUserExternalType.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptActionAttemptId.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptActionAttemptIdError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptEight.java rename src/main/java/com/seam/api/types/{ActionAttemptErrorError.java => ActionAttemptEightError.java} (77%) create mode 100644 src/main/java/com/seam/api/types/ActionAttemptEighteen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptEleven.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptElevenError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFifteen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFive.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFiveError.java rename src/main/java/com/seam/api/types/{ActionAttemptError.java => ActionAttemptForty.java} (53%) create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFortyOne.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFortyOneError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFortyThree.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFortyTwo.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFour.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFourResult.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFourteen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptFourteenError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptNine.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptNineteen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptNineteenResult.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptOne.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptOneResult.java delete mode 100644 src/main/java/com/seam/api/types/ActionAttemptPending.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptSeven.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptSevenResult.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptSeventeen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptSeventeenError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptSix.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptSixteen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptSixteenResult.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTenResult.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirteen.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirteenResult.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirty.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyEight.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyEightError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyFive.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyFiveError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyFour.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyNine.java rename src/main/java/com/seam/api/types/{ActionAttemptSuccess.java => ActionAttemptThirtyOne.java} (54%) create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtySeven.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtySix.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyThree.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyTwo.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThirtyTwoError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptThree.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwelve.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwenty.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyEight.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyFive.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyFour.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyNine.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyNineError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyOne.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentySeven.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentySix.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentySixError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyThree.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyThreeError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyTwo.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwentyTwoResult.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwo.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptTwoError.java create mode 100644 src/main/java/com/seam/api/types/ActionAttemptZero.java create mode 100644 src/main/java/com/seam/api/types/ClimateSettingScheduleHvacModeSetting.java rename src/main/java/com/seam/api/types/{CustomMetadataValue.java => ConnectWebviewCustomMetadataValue.java} (56%) create mode 100644 src/main/java/com/seam/api/types/DeviceCustomMetadataValue.java delete mode 100644 src/main/java/com/seam/api/types/DeviceListProvider.java create mode 100644 src/main/java/com/seam/api/types/DeviceLocation.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypad.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypadBattery.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesAppearance.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java rename src/main/java/com/seam/api/types/{AugustDeviceMetadata.java => DevicePropertiesAugustMetadata.java} (84%) create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesAvigilonAltaMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesBattery.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesBatteryStatus.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesBrivoMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItem.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLength.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLengthConstraintType.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZero.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZeroConstraintType.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesControlbywebMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesEcobeeMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesFourSuitesMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesGenieMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesHoneywellResideoMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesHubitatMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesIglooMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesIgloohomeMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesKeypadBattery.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesKwiksetMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesLocklyMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesMinutMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValues.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesHumidity.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesPressure.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesSound.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesTemperature.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesNestMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadataDeviceModel.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesNukiMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesSaltoMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesSchlageMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadataUnlockMethod.java rename src/main/java/com/seam/api/types/{SchlageDeviceMetadata.java => DevicePropertiesSmartthingsMetadata.java} (71%) create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesTedeeMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesTtlockMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesTwoNMetadata.java create mode 100644 src/main/java/com/seam/api/types/DevicePropertiesWyzeMetadata.java rename src/main/java/com/seam/api/types/{DevicesListDeviceProvidersResponseDeviceProvidersItem.java => DeviceProvider.java} (59%) rename src/main/java/com/seam/api/types/{AcceptedProvider.java => DeviceProviderDeviceProviderName.java} (66%) rename src/main/java/com/seam/api/types/{DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem.java => DeviceProviderProviderCategoriesItem.java} (51%) delete mode 100644 src/main/java/com/seam/api/types/DevicesUpdateRequestLocation.java create mode 100644 src/main/java/com/seam/api/types/EnrollmentAutomation.java rename src/main/java/com/seam/api/types/{EventsListRequestEventTypesItem.java => EventType.java} (64%) delete mode 100644 src/main/java/com/seam/api/types/EventsListRequestEventType.java create mode 100644 src/main/java/com/seam/api/types/FanMode.java delete mode 100644 src/main/java/com/seam/api/types/HealthGetHealthResponse.java delete mode 100644 src/main/java/com/seam/api/types/HealthGetServiceHealthResponse.java create mode 100644 src/main/java/com/seam/api/types/MaxTimeRounding.java create mode 100644 src/main/java/com/seam/api/types/Network.java create mode 100644 src/main/java/com/seam/api/types/Phone.java rename src/main/java/com/seam/api/types/{SupportedCapabililty.java => PhoneCapabilitiesSupportedItem.java} (72%) create mode 100644 src/main/java/com/seam/api/types/PhoneCustomMetadataValue.java create mode 100644 src/main/java/com/seam/api/types/PhoneDeviceType.java create mode 100644 src/main/java/com/seam/api/types/PhoneErrorsItem.java create mode 100644 src/main/java/com/seam/api/types/PhoneLocation.java create mode 100644 src/main/java/com/seam/api/types/PhoneOperatingSystem.java create mode 100644 src/main/java/com/seam/api/types/PhoneProperties.java create mode 100644 src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadata.java create mode 100644 src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java create mode 100644 src/main/java/com/seam/api/types/PhoneWarningsItem.java delete mode 100644 src/main/java/com/seam/api/types/ServiceByServiceNameResponse.java delete mode 100644 src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCode.java delete mode 100644 src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing.java delete mode 100644 src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt.java delete mode 100644 src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound.java delete mode 100644 src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt.java rename src/main/java/com/seam/api/types/{UnmanagedGetResponseAccessCode.java => UnmanagedAccessCode.java} (70%) rename src/main/java/com/seam/api/types/{UnmanagedGetResponseAccessCodeType.java => UnmanagedAccessCodeType.java} (75%) create mode 100644 src/main/java/com/seam/api/types/UnmanagedDeviceCapabilitiesSupportedItem.java create mode 100644 src/main/java/com/seam/api/types/UnmanagedDeviceDeviceProvider.java create mode 100644 src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypad.java create mode 100644 src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypadBattery.java create mode 100644 src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBattery.java create mode 100644 src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBatteryStatus.java delete mode 100644 src/main/java/com/seam/api/types/UnmanagedListResponseAccessCodesItem.java create mode 100644 src/main/java/com/seam/api/types/UserIdentity.java diff --git a/build.gradle b/build.gradle index bb5eb9b..5708de1 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - api 'com.squareup.okhttp3:okhttp:4.9.3' + api 'com.squareup.okhttp3:okhttp:4.12.0' api 'com.fasterxml.jackson.core:jackson-databind:2.13.0' api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.3' api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3' @@ -47,8 +47,15 @@ publishing { maven(MavenPublication) { groupId = 'io.github.seamapi' artifactId = 'java' - version = '0.2.1' + version = '0.3.0' from components.java + pom { + scm { + connection = 'scm:git:git://github.com/seamapi/java.git' + developerConnection = 'scm:git:git://github.com/seamapi/java.git' + url = 'https://github.com/seamapi/java' + } + } } } repositories { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135c49b765f8051ef9d0a6055ff8e46073d8..e6441136f3d4ba8a0da8d277868979cfbc8ad796 100644 GIT binary patch literal 43453 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`; zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf zR2h?lbDZQ`p9P;&DQ4F0sur@TMa!Y}S8irn(%d-gi0*WxxCSk*A?3lGh=gcYN?FGl z7D=Js!i~0=u3rox^eO3i@$0=n{K1lPNU zwmfjRVmLOCRfe=seV&P*1Iq=^i`502keY8Uy-WNPwVNNtJFx?IwAyRPZo2Wo1+S(xF37LJZ~%i)kpFQ3Fw=mXfd@>%+)RpYQLnr}B~~zoof(JVm^^&f zxKV^+3D3$A1G;qh4gPVjhrC8e(VYUHv#dy^)(RoUFM?o%W-EHxufuWf(l*@-l+7vt z=l`qmR56K~F|v<^Pd*p~1_y^P0P^aPC##d8+HqX4IR1gu+7w#~TBFphJxF)T$2WEa zxa?H&6=Qe7d(#tha?_1uQys2KtHQ{)Qco)qwGjrdNL7thd^G5i8Os)CHqc>iOidS} z%nFEDdm=GXBw=yXe1W-ShHHFb?Cc70+$W~z_+}nAoHFYI1MV1wZegw*0y^tC*s%3h zhD3tN8b=Gv&rj}!SUM6|ajSPp*58KR7MPpI{oAJCtY~JECm)*m_x>AZEu>DFgUcby z1Qaw8lU4jZpQ_$;*7RME+gq1KySGG#Wql>aL~k9tLrSO()LWn*q&YxHEuzmwd1?aAtI zBJ>P=&$=l1efe1CDU;`Fd+_;&wI07?V0aAIgc(!{a z0Jg6Y=inXc3^n!U0Atk`iCFIQooHqcWhO(qrieUOW8X(x?(RD}iYDLMjSwffH2~tB z)oDgNBLB^AJBM1M^c5HdRx6fBfka`(LD-qrlh5jqH~);#nw|iyp)()xVYak3;Ybik z0j`(+69aK*B>)e_p%=wu8XC&9e{AO4c~O1U`5X9}?0mrd*m$_EUek{R?DNSh(=br# z#Q61gBzEpmy`$pA*6!87 zSDD+=@fTY7<4A?GLqpA?Pb2z$pbCc4B4zL{BeZ?F-8`s$?>*lXXtn*NC61>|*w7J* z$?!iB{6R-0=KFmyp1nnEmLsA-H0a6l+1uaH^g%c(p{iT&YFrbQ$&PRb8Up#X3@Zsk zD^^&LK~111%cqlP%!_gFNa^dTYT?rhkGl}5=fL{a`UViaXWI$k-UcHJwmaH1s=S$4 z%4)PdWJX;hh5UoK?6aWoyLxX&NhNRqKam7tcOkLh{%j3K^4Mgx1@i|Pi&}<^5>hs5 zm8?uOS>%)NzT(%PjVPGa?X%`N2TQCKbeH2l;cTnHiHppPSJ<7y-yEIiC!P*ikl&!B z%+?>VttCOQM@ShFguHVjxX^?mHX^hSaO_;pnyh^v9EumqSZTi+#f&_Vaija0Q-e*| z7ulQj6Fs*bbmsWp{`auM04gGwsYYdNNZcg|ph0OgD>7O}Asn7^Z=eI>`$2*v78;sj-}oMoEj&@)9+ycEOo92xSyY344^ z11Hb8^kdOvbf^GNAK++bYioknrpdN>+u8R?JxG=!2Kd9r=YWCOJYXYuM0cOq^FhEd zBg2puKy__7VT3-r*dG4c62Wgxi52EMCQ`bKgf*#*ou(D4-ZN$+mg&7$u!! z-^+Z%;-3IDwqZ|K=ah85OLwkO zKxNBh+4QHh)u9D?MFtpbl)us}9+V!D%w9jfAMYEb>%$A;u)rrI zuBudh;5PN}_6J_}l55P3l_)&RMlH{m!)ai-i$g)&*M`eN$XQMw{v^r@-125^RRCF0 z^2>|DxhQw(mtNEI2Kj(;KblC7x=JlK$@78`O~>V!`|1Lm-^JR$-5pUANAnb(5}B}JGjBsliK4& zk6y(;$e&h)lh2)L=bvZKbvh@>vLlreBdH8No2>$#%_Wp1U0N7Ank!6$dFSi#xzh|( zRi{Uw%-4W!{IXZ)fWx@XX6;&(m_F%c6~X8hx=BN1&q}*( zoaNjWabE{oUPb!Bt$eyd#$5j9rItB-h*5JiNi(v^e|XKAj*8(k<5-2$&ZBR5fF|JA z9&m4fbzNQnAU}r8ab>fFV%J0z5awe#UZ|bz?Ur)U9bCIKWEzi2%A+5CLqh?}K4JHi z4vtM;+uPsVz{Lfr;78W78gC;z*yTch~4YkLr&m-7%-xc ztw6Mh2d>_iO*$Rd8(-Cr1_V8EO1f*^@wRoSozS) zy1UoC@pruAaC8Z_7~_w4Q6n*&B0AjOmMWa;sIav&gu z|J5&|{=a@vR!~k-OjKEgPFCzcJ>#A1uL&7xTDn;{XBdeM}V=l3B8fE1--DHjSaxoSjNKEM9|U9#m2<3>n{Iuo`r3UZp;>GkT2YBNAh|b z^jTq-hJp(ebZh#Lk8hVBP%qXwv-@vbvoREX$TqRGTgEi$%_F9tZES@z8Bx}$#5eeG zk^UsLBH{bc2VBW)*EdS({yw=?qmevwi?BL6*=12k9zM5gJv1>y#ML4!)iiPzVaH9% zgSImetD@dam~e>{LvVh!phhzpW+iFvWpGT#CVE5TQ40n%F|p(sP5mXxna+Ev7PDwA zamaV4m*^~*xV+&p;W749xhb_X=$|LD;FHuB&JL5?*Y2-oIT(wYY2;73<^#46S~Gx| z^cez%V7x$81}UWqS13Gz80379Rj;6~WdiXWOSsdmzY39L;Hg3MH43o*y8ibNBBH`(av4|u;YPq%{R;IuYow<+GEsf@R?=@tT@!}?#>zIIn0CoyV!hq3mw zHj>OOjfJM3F{RG#6ujzo?y32m^tgSXf@v=J$ELdJ+=5j|=F-~hP$G&}tDZsZE?5rX ztGj`!S>)CFmdkccxM9eGIcGnS2AfK#gXwj%esuIBNJQP1WV~b~+D7PJTmWGTSDrR` zEAu4B8l>NPuhsk5a`rReSya2nfV1EK01+G!x8aBdTs3Io$u5!6n6KX%uv@DxAp3F@{4UYg4SWJtQ-W~0MDb|j-$lwVn znAm*Pl!?Ps&3wO=R115RWKb*JKoexo*)uhhHBncEDMSVa_PyA>k{Zm2(wMQ(5NM3# z)jkza|GoWEQo4^s*wE(gHz?Xsg4`}HUAcs42cM1-qq_=+=!Gk^y710j=66(cSWqUe zklbm8+zB_syQv5A2rj!Vbw8;|$@C!vfNmNV!yJIWDQ>{+2x zKjuFX`~~HKG~^6h5FntRpnnHt=D&rq0>IJ9#F0eM)Y-)GpRjiN7gkA8wvnG#K=q{q z9dBn8_~wm4J<3J_vl|9H{7q6u2A!cW{bp#r*-f{gOV^e=8S{nc1DxMHFwuM$;aVI^ zz6A*}m8N-&x8;aunp1w7_vtB*pa+OYBw=TMc6QK=mbA-|Cf* zvyh8D4LRJImooUaSb7t*fVfih<97Gf@VE0|z>NcBwBQze);Rh!k3K_sfunToZY;f2 z^HmC4KjHRVg+eKYj;PRN^|E0>Gj_zagfRbrki68I^#~6-HaHg3BUW%+clM1xQEdPYt_g<2K+z!$>*$9nQ>; zf9Bei{?zY^-e{q_*|W#2rJG`2fy@{%6u0i_VEWTq$*(ZN37|8lFFFt)nCG({r!q#9 z5VK_kkSJ3?zOH)OezMT{!YkCuSSn!K#-Rhl$uUM(bq*jY? zi1xbMVthJ`E>d>(f3)~fozjg^@eheMF6<)I`oeJYx4*+M&%c9VArn(OM-wp%M<-`x z7sLP1&3^%Nld9Dhm@$3f2}87!quhI@nwd@3~fZl_3LYW-B?Ia>ui`ELg z&Qfe!7m6ze=mZ`Ia9$z|ARSw|IdMpooY4YiPN8K z4B(ts3p%2i(Td=tgEHX z0UQ_>URBtG+-?0E;E7Ld^dyZ;jjw0}XZ(}-QzC6+NN=40oDb2^v!L1g9xRvE#@IBR zO!b-2N7wVfLV;mhEaXQ9XAU+>=XVA6f&T4Z-@AX!leJ8obP^P^wP0aICND?~w&NykJ#54x3_@r7IDMdRNy4Hh;h*!u(Ol(#0bJdwEo$5437-UBjQ+j=Ic>Q2z` zJNDf0yO6@mr6y1#n3)s(W|$iE_i8r@Gd@!DWDqZ7J&~gAm1#~maIGJ1sls^gxL9LLG_NhU!pTGty!TbhzQnu)I*S^54U6Yu%ZeCg`R>Q zhBv$n5j0v%O_j{QYWG!R9W?5_b&67KB$t}&e2LdMvd(PxN6Ir!H4>PNlerpBL>Zvyy!yw z-SOo8caEpDt(}|gKPBd$qND5#a5nju^O>V&;f890?yEOfkSG^HQVmEbM3Ugzu+UtH zC(INPDdraBN?P%kE;*Ae%Wto&sgw(crfZ#Qy(<4nk;S|hD3j{IQRI6Yq|f^basLY; z-HB&Je%Gg}Jt@={_C{L$!RM;$$|iD6vu#3w?v?*;&()uB|I-XqEKqZPS!reW9JkLewLb!70T7n`i!gNtb1%vN- zySZj{8-1>6E%H&=V}LM#xmt`J3XQoaD|@XygXjdZ1+P77-=;=eYpoEQ01B@L*a(uW zrZeZz?HJsw_4g0vhUgkg@VF8<-X$B8pOqCuWAl28uB|@r`19DTUQQsb^pfqB6QtiT z*`_UZ`fT}vtUY#%sq2{rchyfu*pCg;uec2$-$N_xgjZcoumE5vSI{+s@iLWoz^Mf; zuI8kDP{!XY6OP~q5}%1&L}CtfH^N<3o4L@J@zg1-mt{9L`s^z$Vgb|mr{@WiwAqKg zp#t-lhrU>F8o0s1q_9y`gQNf~Vb!F%70f}$>i7o4ho$`uciNf=xgJ>&!gSt0g;M>*x4-`U)ysFW&Vs^Vk6m%?iuWU+o&m(2Jm26Y(3%TL; zA7T)BP{WS!&xmxNw%J=$MPfn(9*^*TV;$JwRy8Zl*yUZi8jWYF>==j~&S|Xinsb%c z2?B+kpet*muEW7@AzjBA^wAJBY8i|#C{WtO_or&Nj2{=6JTTX05}|H>N2B|Wf!*3_ z7hW*j6p3TvpghEc6-wufFiY!%-GvOx*bZrhZu+7?iSrZL5q9}igiF^*R3%DE4aCHZ zqu>xS8LkW+Auv%z-<1Xs92u23R$nk@Pk}MU5!gT|c7vGlEA%G^2th&Q*zfg%-D^=f z&J_}jskj|Q;73NP4<4k*Y%pXPU2Thoqr+5uH1yEYM|VtBPW6lXaetokD0u z9qVek6Q&wk)tFbQ8(^HGf3Wp16gKmr>G;#G(HRBx?F`9AIRboK+;OfHaLJ(P>IP0w zyTbTkx_THEOs%Q&aPrxbZrJlio+hCC_HK<4%f3ZoSAyG7Dn`=X=&h@m*|UYO-4Hq0 z-Bq&+Ie!S##4A6OGoC~>ZW`Y5J)*ouaFl_e9GA*VSL!O_@xGiBw!AF}1{tB)z(w%c zS1Hmrb9OC8>0a_$BzeiN?rkPLc9%&;1CZW*4}CDDNr2gcl_3z+WC15&H1Zc2{o~i) z)LLW=WQ{?ricmC`G1GfJ0Yp4Dy~Ba;j6ZV4r{8xRs`13{dD!xXmr^Aga|C=iSmor% z8hi|pTXH)5Yf&v~exp3o+sY4B^^b*eYkkCYl*T{*=-0HniSA_1F53eCb{x~1k3*`W zr~};p1A`k{1DV9=UPnLDgz{aJH=-LQo<5%+Em!DNN252xwIf*wF_zS^!(XSm(9eoj z=*dXG&n0>)_)N5oc6v!>-bd(2ragD8O=M|wGW z!xJQS<)u70m&6OmrF0WSsr@I%T*c#Qo#Ha4d3COcX+9}hM5!7JIGF>7<~C(Ear^Sn zm^ZFkV6~Ula6+8S?oOROOA6$C&q&dp`>oR-2Ym3(HT@O7Sd5c~+kjrmM)YmgPH*tL zX+znN>`tv;5eOfX?h{AuX^LK~V#gPCu=)Tigtq9&?7Xh$qN|%A$?V*v=&-2F$zTUv z`C#WyIrChS5|Kgm_GeudCFf;)!WH7FI60j^0o#65o6`w*S7R@)88n$1nrgU(oU0M9 zx+EuMkC>(4j1;m6NoGqEkpJYJ?vc|B zOlwT3t&UgL!pX_P*6g36`ZXQ; z9~Cv}ANFnJGp(;ZhS(@FT;3e)0)Kp;h^x;$*xZn*k0U6-&FwI=uOGaODdrsp-!K$Ac32^c{+FhI-HkYd5v=`PGsg%6I`4d9Jy)uW0y%) zm&j^9WBAp*P8#kGJUhB!L?a%h$hJgQrx!6KCB_TRo%9{t0J7KW8!o1B!NC)VGLM5! zpZy5Jc{`r{1e(jd%jsG7k%I+m#CGS*BPA65ZVW~fLYw0dA-H_}O zrkGFL&P1PG9p2(%QiEWm6x;U-U&I#;Em$nx-_I^wtgw3xUPVVu zqSuKnx&dIT-XT+T10p;yjo1Y)z(x1fb8Dzfn8e yu?e%!_ptzGB|8GrCfu%p?(_ zQccdaaVK$5bz;*rnyK{_SQYM>;aES6Qs^lj9lEs6_J+%nIiuQC*fN;z8md>r_~Mfl zU%p5Dt_YT>gQqfr@`cR!$NWr~+`CZb%dn;WtzrAOI>P_JtsB76PYe*<%H(y>qx-`Kq!X_; z<{RpAqYhE=L1r*M)gNF3B8r(<%8mo*SR2hu zccLRZwGARt)Hlo1euqTyM>^!HK*!Q2P;4UYrysje@;(<|$&%vQekbn|0Ruu_Io(w4#%p6ld2Yp7tlA`Y$cciThP zKzNGIMPXX%&Ud0uQh!uQZz|FB`4KGD?3!ND?wQt6!n*f4EmCoJUh&b?;B{|lxs#F- z31~HQ`SF4x$&v00@(P+j1pAaj5!s`)b2RDBp*PB=2IB>oBF!*6vwr7Dp%zpAx*dPr zb@Zjq^XjN?O4QcZ*O+8>)|HlrR>oD*?WQl5ri3R#2?*W6iJ>>kH%KnnME&TT@ZzrHS$Q%LC?n|e>V+D+8D zYc4)QddFz7I8#}y#Wj6>4P%34dZH~OUDb?uP%-E zwjXM(?Sg~1!|wI(RVuxbu)-rH+O=igSho_pDCw(c6b=P zKk4ATlB?bj9+HHlh<_!&z0rx13K3ZrAR8W)!@Y}o`?a*JJsD+twZIv`W)@Y?Amu_u zz``@-e2X}27$i(2=9rvIu5uTUOVhzwu%mNazS|lZb&PT;XE2|B&W1>=B58#*!~D&) zfVmJGg8UdP*fx(>Cj^?yS^zH#o-$Q-*$SnK(ZVFkw+er=>N^7!)FtP3y~Xxnu^nzY zikgB>Nj0%;WOltWIob|}%lo?_C7<``a5hEkx&1ku$|)i>Rh6@3h*`slY=9U}(Ql_< zaNG*J8vb&@zpdhAvv`?{=zDedJ23TD&Zg__snRAH4eh~^oawdYi6A3w8<Ozh@Kw)#bdktM^GVb zrG08?0bG?|NG+w^&JvD*7LAbjED{_Zkc`3H!My>0u5Q}m!+6VokMLXxl`Mkd=g&Xx z-a>m*#G3SLlhbKB!)tnzfWOBV;u;ftU}S!NdD5+YtOjLg?X}dl>7m^gOpihrf1;PY zvll&>dIuUGs{Qnd- zwIR3oIrct8Va^Tm0t#(bJD7c$Z7DO9*7NnRZorrSm`b`cxz>OIC;jSE3DO8`hX955ui`s%||YQtt2 z5DNA&pG-V+4oI2s*x^>-$6J?p=I>C|9wZF8z;VjR??Icg?1w2v5Me+FgAeGGa8(3S z4vg*$>zC-WIVZtJ7}o9{D-7d>zCe|z#<9>CFve-OPAYsneTb^JH!Enaza#j}^mXy1 z+ULn^10+rWLF6j2>Ya@@Kq?26>AqK{A_| zQKb*~F1>sE*=d?A?W7N2j?L09_7n+HGi{VY;MoTGr_)G9)ot$p!-UY5zZ2Xtbm=t z@dpPSGwgH=QtIcEulQNI>S-#ifbnO5EWkI;$A|pxJd885oM+ zGZ0_0gDvG8q2xebj+fbCHYfAXuZStH2j~|d^sBAzo46(K8n59+T6rzBwK)^rfPT+B zyIFw)9YC-V^rhtK`!3jrhmW-sTmM+tPH+;nwjL#-SjQPUZ53L@A>y*rt(#M(qsiB2 zx6B)dI}6Wlsw%bJ8h|(lhkJVogQZA&n{?Vgs6gNSXzuZpEyu*xySy8ro07QZ7Vk1!3tJphN_5V7qOiyK8p z#@jcDD8nmtYi1^l8ml;AF<#IPK?!pqf9D4moYk>d99Im}Jtwj6c#+A;f)CQ*f-hZ< z=p_T86jog%!p)D&5g9taSwYi&eP z#JuEK%+NULWus;0w32-SYFku#i}d~+{Pkho&^{;RxzP&0!RCm3-9K6`>KZpnzS6?L z^H^V*s!8<>x8bomvD%rh>Zp3>Db%kyin;qtl+jAv8Oo~1g~mqGAC&Qi_wy|xEt2iz zWAJEfTV%cl2Cs<1L&DLRVVH05EDq`pH7Oh7sR`NNkL%wi}8n>IXcO40hp+J+sC!W?!krJf!GJNE8uj zg-y~Ns-<~D?yqbzVRB}G>0A^f0!^N7l=$m0OdZuqAOQqLc zX?AEGr1Ht+inZ-Qiwnl@Z0qukd__a!C*CKuGdy5#nD7VUBM^6OCpxCa2A(X;e0&V4 zM&WR8+wErQ7UIc6LY~Q9x%Sn*Tn>>P`^t&idaOEnOd(Ufw#>NoR^1QdhJ8s`h^|R_ zXX`c5*O~Xdvh%q;7L!_!ohf$NfEBmCde|#uVZvEo>OfEq%+Ns7&_f$OR9xsihRpBb z+cjk8LyDm@U{YN>+r46?nn{7Gh(;WhFw6GAxtcKD+YWV?uge>;+q#Xx4!GpRkVZYu zzsF}1)7$?%s9g9CH=Zs+B%M_)+~*j3L0&Q9u7!|+T`^O{xE6qvAP?XWv9_MrZKdo& z%IyU)$Q95AB4!#hT!_dA>4e@zjOBD*Y=XjtMm)V|+IXzjuM;(l+8aA5#Kaz_$rR6! zj>#&^DidYD$nUY(D$mH`9eb|dtV0b{S>H6FBfq>t5`;OxA4Nn{J(+XihF(stSche7$es&~N$epi&PDM_N`As;*9D^L==2Q7Z2zD+CiU(|+-kL*VG+&9!Yb3LgPy?A zm7Z&^qRG_JIxK7-FBzZI3Q<;{`DIxtc48k> zc|0dmX;Z=W$+)qE)~`yn6MdoJ4co;%!`ddy+FV538Y)j(vg}5*k(WK)KWZ3WaOG!8 z!syGn=s{H$odtpqFrT#JGM*utN7B((abXnpDM6w56nhw}OY}0TiTG1#f*VFZr+^-g zbP10`$LPq_;PvrA1XXlyx2uM^mrjTzX}w{yuLo-cOClE8MMk47T25G8M!9Z5ypOSV zAJUBGEg5L2fY)ZGJb^E34R2zJ?}Vf>{~gB!8=5Z) z9y$>5c)=;o0HeHHSuE4U)#vG&KF|I%-cF6f$~pdYJWk_dD}iOA>iA$O$+4%@>JU08 zS`ep)$XLPJ+n0_i@PkF#ri6T8?ZeAot$6JIYHm&P6EB=BiaNY|aA$W0I+nz*zkz_z zkEru!tj!QUffq%)8y0y`T&`fuus-1p>=^hnBiBqD^hXrPs`PY9tU3m0np~rISY09> z`P3s=-kt_cYcxWd{de@}TwSqg*xVhp;E9zCsnXo6z z?f&Sv^U7n4`xr=mXle94HzOdN!2kB~4=%)u&N!+2;z6UYKUDqi-s6AZ!haB;@&B`? z_TRX0%@suz^TRdCb?!vNJYPY8L_}&07uySH9%W^Tc&1pia6y1q#?*Drf}GjGbPjBS zbOPcUY#*$3sL2x4v_i*Y=N7E$mR}J%|GUI(>WEr+28+V z%v5{#e!UF*6~G&%;l*q*$V?&r$Pp^sE^i-0$+RH3ERUUdQ0>rAq2(2QAbG}$y{de( z>{qD~GGuOk559Y@%$?N^1ApVL_a704>8OD%8Y%8B;FCt%AoPu8*D1 zLB5X>b}Syz81pn;xnB}%0FnwazlWfUV)Z-~rZg6~b z6!9J$EcE&sEbzcy?CI~=boWA&eeIa%z(7SE^qgVLz??1Vbc1*aRvc%Mri)AJaAG!p z$X!_9Ds;Zz)f+;%s&dRcJt2==P{^j3bf0M=nJd&xwUGlUFn?H=2W(*2I2Gdu zv!gYCwM10aeus)`RIZSrCK=&oKaO_Ry~D1B5!y0R=%!i2*KfXGYX&gNv_u+n9wiR5 z*e$Zjju&ODRW3phN925%S(jL+bCHv6rZtc?!*`1TyYXT6%Ju=|X;6D@lq$8T zW{Y|e39ioPez(pBH%k)HzFITXHvnD6hw^lIoUMA;qAJ^CU?top1fo@s7xT13Fvn1H z6JWa-6+FJF#x>~+A;D~;VDs26>^oH0EI`IYT2iagy23?nyJ==i{g4%HrAf1-*v zK1)~@&(KkwR7TL}L(A@C_S0G;-GMDy=MJn2$FP5s<%wC)4jC5PXoxrQBFZ_k0P{{s@sz+gX`-!=T8rcB(=7vW}^K6oLWMmp(rwDh}b zwaGGd>yEy6fHv%jM$yJXo5oMAQ>c9j`**}F?MCry;T@47@r?&sKHgVe$MCqk#Z_3S z1GZI~nOEN*P~+UaFGnj{{Jo@16`(qVNtbU>O0Hf57-P>x8Jikp=`s8xWs^dAJ9lCQ z)GFm+=OV%AMVqVATtN@|vp61VVAHRn87}%PC^RAzJ%JngmZTasWBAWsoAqBU+8L8u z4A&Pe?fmTm0?mK-BL9t+{y7o(7jm+RpOhL9KnY#E&qu^}B6=K_dB}*VlSEiC9fn)+V=J;OnN)Ta5v66ic1rG+dGAJ1 z1%Zb_+!$=tQ~lxQrzv3x#CPb?CekEkA}0MYSgx$Jdd}q8+R=ma$|&1a#)TQ=l$1tQ z=tL9&_^vJ)Pk}EDO-va`UCT1m#Uty1{v^A3P~83_#v^ozH}6*9mIjIr;t3Uv%@VeW zGL6(CwCUp)Jq%G0bIG%?{_*Y#5IHf*5M@wPo6A{$Um++Co$wLC=J1aoG93&T7Ho}P z=mGEPP7GbvoG!uD$k(H3A$Z))+i{Hy?QHdk>3xSBXR0j!11O^mEe9RHmw!pvzv?Ua~2_l2Yh~_!s1qS`|0~0)YsbHSz8!mG)WiJE| z2f($6TQtt6L_f~ApQYQKSb=`053LgrQq7G@98#igV>y#i==-nEjQ!XNu9 z~;mE+gtj4IDDNQJ~JVk5Ux6&LCSFL!y=>79kE9=V}J7tD==Ga+IW zX)r7>VZ9dY=V&}DR))xUoV!u(Z|%3ciQi_2jl}3=$Agc(`RPb z8kEBpvY>1FGQ9W$n>Cq=DIpski};nE)`p3IUw1Oz0|wxll^)4dq3;CCY@RyJgFgc# zKouFh!`?Xuo{IMz^xi-h=StCis_M7yq$u) z?XHvw*HP0VgR+KR6wI)jEMX|ssqYvSf*_3W8zVTQzD?3>H!#>InzpSO)@SC8q*ii- z%%h}_#0{4JG;Jm`4zg};BPTGkYamx$Xo#O~lBirRY)q=5M45n{GCfV7h9qwyu1NxOMoP4)jjZMxmT|IQQh0U7C$EbnMN<3)Kk?fFHYq$d|ICu>KbY_hO zTZM+uKHe(cIZfEqyzyYSUBZa8;Fcut-GN!HSA9ius`ltNebF46ZX_BbZNU}}ZOm{M2&nANL9@0qvih15(|`S~z}m&h!u4x~(%MAO$jHRWNfuxWF#B)E&g3ghSQ9|> z(MFaLQj)NE0lowyjvg8z0#m6FIuKE9lDO~Glg}nSb7`~^&#(Lw{}GVOS>U)m8bF}x zVjbXljBm34Cs-yM6TVusr+3kYFjr28STT3g056y3cH5Tmge~ASxBj z%|yb>$eF;WgrcOZf569sDZOVwoo%8>XO>XQOX1OyN9I-SQgrm;U;+#3OI(zrWyow3 zk==|{lt2xrQ%FIXOTejR>;wv(Pb8u8}BUpx?yd(Abh6? zsoO3VYWkeLnF43&@*#MQ9-i-d0t*xN-UEyNKeyNMHw|A(k(_6QKO=nKMCxD(W(Yop zsRQ)QeL4X3Lxp^L%wzi2-WVSsf61dqliPUM7srDB?Wm6Lzn0&{*}|IsKQW;02(Y&| zaTKv|`U(pSzuvR6Rduu$wzK_W-Y-7>7s?G$)U}&uK;<>vU}^^ns@Z!p+9?St1s)dG zK%y6xkPyyS1$~&6v{kl?Md6gwM|>mt6Upm>oa8RLD^8T{0?HC!Z>;(Bob7el(DV6x zi`I)$&E&ngwFS@bi4^xFLAn`=fzTC;aimE^!cMI2n@Vo%Ae-ne`RF((&5y6xsjjAZ zVguVoQ?Z9uk$2ON;ersE%PU*xGO@T*;j1BO5#TuZKEf(mB7|g7pcEA=nYJ{s3vlbg zd4-DUlD{*6o%Gc^N!Nptgay>j6E5;3psI+C3Q!1ZIbeCubW%w4pq9)MSDyB{HLm|k zxv-{$$A*pS@csolri$Ge<4VZ}e~78JOL-EVyrbxKra^d{?|NnPp86!q>t<&IP07?Z z^>~IK^k#OEKgRH+LjllZXk7iA>2cfH6+(e&9ku5poo~6y{GC5>(bRK7hwjiurqAiZ zg*DmtgY}v83IjE&AbiWgMyFbaRUPZ{lYiz$U^&Zt2YjG<%m((&_JUbZcfJ22(>bi5 z!J?<7AySj0JZ&<-qXX;mcV!f~>G=sB0KnjWca4}vrtunD^1TrpfeS^4dvFr!65knK zZh`d;*VOkPs4*-9kL>$GP0`(M!j~B;#x?Ba~&s6CopvO86oM?-? zOw#dIRc;6A6T?B`Qp%^<U5 z19x(ywSH$_N+Io!6;e?`tWaM$`=Db!gzx|lQ${DG!zb1Zl&|{kX0y6xvO1o z220r<-oaS^^R2pEyY;=Qllqpmue|5yI~D|iI!IGt@iod{Opz@*ml^w2bNs)p`M(Io z|E;;m*Xpjd9l)4G#KaWfV(t8YUn@A;nK^#xgv=LtnArX|vWQVuw3}B${h+frU2>9^ z!l6)!Uo4`5k`<<;E(ido7M6lKTgWezNLq>U*=uz&s=cc$1%>VrAeOoUtA|T6gO4>UNqsdK=NF*8|~*sl&wI=x9-EGiq*aqV!(VVXA57 zw9*o6Ir8Lj1npUXvlevtn(_+^X5rzdR>#(}4YcB9O50q97%rW2me5_L=%ffYPUSRc z!vv?Kv>dH994Qi>U(a<0KF6NH5b16enCp+mw^Hb3Xs1^tThFpz!3QuN#}KBbww`(h z7GO)1olDqy6?T$()R7y%NYx*B0k_2IBiZ14&8|JPFxeMF{vSTxF-Vi3+ZOI=Thq2} zyQgjYY1_7^ZQHh{?P))4+qUiQJLi1&{yE>h?~jU%tjdV0h|FENbM3X(KnJdPKc?~k zh=^Ixv*+smUll!DTWH!jrV*wSh*(mx0o6}1@JExzF(#9FXgmTXVoU+>kDe68N)dkQ zH#_98Zv$}lQwjKL@yBd;U(UD0UCl322=pav<=6g>03{O_3oKTq;9bLFX1ia*lw;#K zOiYDcBJf)82->83N_Y(J7Kr_3lE)hAu;)Q(nUVydv+l+nQ$?|%MWTy`t>{havFSQloHwiIkGK9YZ79^9?AZo0ZyQlVR#}lF%dn5n%xYksXf8gnBm=wO7g_^! zauQ-bH1Dc@3ItZ-9D_*pH}p!IG7j8A_o94#~>$LR|TFq zZ-b00*nuw|-5C2lJDCw&8p5N~Z1J&TrcyErds&!l3$eSz%`(*izc;-?HAFD9AHb-| z>)id`QCrzRws^9(#&=pIx9OEf2rmlob8sK&xPCWS+nD~qzU|qG6KwA{zbikcfQrdH z+ zQg>O<`K4L8rN7`GJB0*3<3`z({lWe#K!4AZLsI{%z#ja^OpfjU{!{)x0ZH~RB0W5X zTwN^w=|nA!4PEU2=LR05x~}|B&ZP?#pNgDMwD*ajI6oJqv!L81gu=KpqH22avXf0w zX3HjbCI!n9>l046)5rr5&v5ja!xkKK42zmqHzPx$9Nn_MZk`gLeSLgC=LFf;H1O#B zn=8|^1iRrujHfbgA+8i<9jaXc;CQBAmQvMGQPhFec2H1knCK2x!T`e6soyrqCamX% zTQ4dX_E*8so)E*TB$*io{$c6X)~{aWfaqdTh=xEeGvOAN9H&-t5tEE-qso<+C!2>+ zskX51H-H}#X{A75wqFe-J{?o8Bx|>fTBtl&tcbdR|132Ztqu5X0i-pisB-z8n71%q%>EF}yy5?z=Ve`}hVh{Drv1YWL zW=%ug_&chF11gDv3D6B)Tz5g54H0mDHNjuKZ+)CKFk4Z|$RD zfRuKLW`1B>B?*RUfVd0+u8h3r-{@fZ{k)c!93t1b0+Q9vOaRnEn1*IL>5Z4E4dZ!7 ztp4GP-^1d>8~LMeb}bW!(aAnB1tM_*la=Xx)q(I0Y@__Zd$!KYb8T2VBRw%e$iSdZ zkwdMwd}eV9q*;YvrBFTv1>1+}{H!JK2M*C|TNe$ZSA>UHKk);wz$(F$rXVc|sI^lD zV^?_J!3cLM;GJuBMbftbaRUs$;F}HDEDtIeHQ)^EJJ1F9FKJTGH<(Jj`phE6OuvE) zqK^K`;3S{Y#1M@8yRQwH`?kHMq4tHX#rJ>5lY3DM#o@or4&^_xtBC(|JpGTfrbGkA z2Tu+AyT^pHannww!4^!$5?@5v`LYy~T`qs7SYt$JgrY(w%C+IWA;ZkwEF)u5sDvOK zGk;G>Mh&elvXDcV69J_h02l&O;!{$({fng9Rlc3ID#tmB^FIG^w{HLUpF+iB`|
NnX)EH+Nua)3Y(c z&{(nX_ht=QbJ%DzAya}!&uNu!4V0xI)QE$SY__m)SAKcN0P(&JcoK*Lxr@P zY&P=}&B3*UWNlc|&$Oh{BEqwK2+N2U$4WB7Fd|aIal`FGANUa9E-O)!gV`((ZGCc$ zBJA|FFrlg~9OBp#f7aHodCe{6= zay$6vN~zj1ddMZ9gQ4p32(7wD?(dE>KA2;SOzXRmPBiBc6g`eOsy+pVcHu=;Yd8@{ zSGgXf@%sKKQz~;!J;|2fC@emm#^_rnO0esEn^QxXgJYd`#FPWOUU5b;9eMAF zZhfiZb|gk8aJIw*YLp4!*(=3l8Cp{(%p?ho22*vN9+5NLV0TTazNY$B5L6UKUrd$n zjbX%#m7&F#U?QNOBXkiiWB*_tk+H?N3`vg;1F-I+83{M2!8<^nydGr5XX}tC!10&e z7D36bLaB56WrjL&HiiMVtpff|K%|*{t*ltt^5ood{FOG0<>k&1h95qPio)2`eL${YAGIx(b4VN*~nKn6E~SIQUuRH zQ+5zP6jfnP$S0iJ@~t!Ai3o`X7biohli;E zT#yXyl{bojG@-TGZzpdVDXhbmF%F9+-^YSIv|MT1l3j zrxOFq>gd2%U}?6}8mIj?M zc077Zc9fq(-)4+gXv?Az26IO6eV`RAJz8e3)SC7~>%rlzDwySVx*q$ygTR5kW2ds- z!HBgcq0KON9*8Ff$X0wOq$`T7ml(@TF)VeoF}x1OttjuVHn3~sHrMB++}f7f9H%@f z=|kP_?#+fve@{0MlbkC9tyvQ_R?lRdRJ@$qcB(8*jyMyeME5ns6ypVI1Xm*Zr{DuS zZ!1)rQfa89c~;l~VkCiHI|PCBd`S*2RLNQM8!g9L6?n`^evQNEwfO@&JJRme+uopQX0%Jo zgd5G&#&{nX{o?TQwQvF1<^Cg3?2co;_06=~Hcb6~4XWpNFL!WU{+CK;>gH%|BLOh7@!hsa(>pNDAmpcuVO-?;Bic17R}^|6@8DahH)G z!EmhsfunLL|3b=M0MeK2vqZ|OqUqS8npxwge$w-4pFVXFq$_EKrZY?BuP@Az@(k`L z`ViQBSk`y+YwRT;&W| z2e3UfkCo^uTA4}Qmmtqs+nk#gNr2W4 zTH%hhErhB)pkXR{B!q5P3-OM+M;qu~f>}IjtF%>w{~K-0*jPVLl?Chz&zIdxp}bjx zStp&Iufr58FTQ36AHU)0+CmvaOpKF;W@sMTFpJ`j;3d)J_$tNQI^c<^1o<49Z(~K> z;EZTBaVT%14(bFw2ob@?JLQ2@(1pCdg3S%E4*dJ}dA*v}_a4_P(a`cHnBFJxNobAv zf&Zl-Yt*lhn-wjZsq<9v-IsXxAxMZ58C@e0!rzhJ+D@9^3~?~yllY^s$?&oNwyH!#~6x4gUrfxplCvK#!f z$viuszW>MFEcFL?>ux*((!L$;R?xc*myjRIjgnQX79@UPD$6Dz0jutM@7h_pq z0Zr)#O<^y_K6jfY^X%A-ip>P%3saX{!v;fxT-*0C_j4=UMH+Xth(XVkVGiiKE#f)q z%Jp=JT)uy{&}Iq2E*xr4YsJ5>w^=#-mRZ4vPXpI6q~1aFwi+lQcimO45V-JXP;>(Q zo={U`{=_JF`EQj87Wf}{Qy35s8r1*9Mxg({CvOt}?Vh9d&(}iI-quvs-rm~P;eRA@ zG5?1HO}puruc@S{YNAF3vmUc2B4!k*yi))<5BQmvd3tr}cIs#9)*AX>t`=~{f#Uz0 z0&Nk!7sSZwJe}=)-R^$0{yeS!V`Dh7w{w5rZ9ir!Z7Cd7dwZcK;BT#V0bzTt>;@Cl z#|#A!-IL6CZ@eHH!CG>OO8!%G8&8t4)Ro@}USB*k>oEUo0LsljsJ-%5Mo^MJF2I8- z#v7a5VdJ-Cd%(a+y6QwTmi+?f8Nxtm{g-+WGL>t;s#epv7ug>inqimZCVm!uT5Pf6 ziEgQt7^%xJf#!aPWbuC_3Nxfb&CFbQy!(8ANpkWLI4oSnH?Q3f?0k1t$3d+lkQs{~(>06l&v|MpcFsyAv zin6N!-;pggosR*vV=DO(#+}4ps|5$`udE%Kdmp?G7B#y%H`R|i8skKOd9Xzx8xgR$>Zo2R2Ytktq^w#ul4uicxW#{ zFjG_RNlBroV_n;a7U(KIpcp*{M~e~@>Q#Av90Jc5v%0c>egEdY4v3%|K1XvB{O_8G zkTWLC>OZKf;XguMH2-Pw{BKbFzaY;4v2seZV0>^7Q~d4O=AwaPhP3h|!hw5aqOtT@ z!SNz}$of**Bl3TK209@F=Tn1+mgZa8yh(Png%Zd6Mt}^NSjy)etQrF zme*llAW=N_8R*O~d2!apJnF%(JcN??=`$qs3Y+~xs>L9x`0^NIn!8mMRFA_tg`etw z3k{9JAjnl@ygIiJcNHTy02GMAvBVqEss&t2<2mnw!; zU`J)0>lWiqVqo|ex7!+@0i>B~BSU1A_0w#Ee+2pJx0BFiZ7RDHEvE*ptc9md(B{&+ zKE>TM)+Pd>HEmdJao7U@S>nL(qq*A)#eLOuIfAS@j`_sK0UEY6OAJJ-kOrHG zjHx`g!9j*_jRcJ%>CE9K2MVf?BUZKFHY?EpV6ai7sET-tqk=nDFh-(65rhjtlKEY% z@G&cQ<5BKatfdA1FKuB=i>CCC5(|9TMW%K~GbA4}80I5%B}(gck#Wlq@$nO3%@QP_ z8nvPkJFa|znk>V92cA!K1rKtr)skHEJD;k8P|R8RkCq1Rh^&}Evwa4BUJz2f!2=MH zo4j8Y$YL2313}H~F7@J7mh>u%556Hw0VUOz-Un@ZASCL)y8}4XXS`t1AC*^>PLwIc zUQok5PFS=*#)Z!3JZN&eZ6ZDP^-c@StY*t20JhCnbMxXf=LK#;`4KHEqMZ-Ly9KsS zI2VUJGY&PmdbM+iT)zek)#Qc#_i4uH43 z@T5SZBrhNCiK~~esjsO9!qBpaWK<`>!-`b71Y5ReXQ4AJU~T2Njri1CEp5oKw;Lnm)-Y@Z3sEY}XIgSy%xo=uek(kAAH5MsV$V3uTUsoTzxp_rF=tx zV07vlJNKtJhCu`b}*#m&5LV4TAE&%KtHViDAdv#c^x`J7bg z&N;#I2GkF@SIGht6p-V}`!F_~lCXjl1BdTLIjD2hH$J^YFN`7f{Q?OHPFEM$65^!u zNwkelo*5+$ZT|oQ%o%;rBX$+?xhvjb)SHgNHE_yP%wYkkvXHS{Bf$OiKJ5d1gI0j< zF6N}Aq=(WDo(J{e-uOecxPD>XZ@|u-tgTR<972`q8;&ZD!cep^@B5CaqFz|oU!iFj zU0;6fQX&~15E53EW&w1s9gQQ~Zk16X%6 zjG`j0yq}4deX2?Tr(03kg>C(!7a|b9qFI?jcE^Y>-VhudI@&LI6Qa}WQ>4H_!UVyF z((cm&!3gmq@;BD#5P~0;_2qgZhtJS|>WdtjY=q zLnHH~Fm!cxw|Z?Vw8*~?I$g#9j&uvgm7vPr#&iZgPP~v~BI4jOv;*OQ?jYJtzO<^y z7-#C={r7CO810!^s(MT!@@Vz_SVU)7VBi(e1%1rvS!?PTa}Uv`J!EP3s6Y!xUgM^8 z4f!fq<3Wer_#;u!5ECZ|^c1{|q_lh3m^9|nsMR1#Qm|?4Yp5~|er2?W^7~cl;_r4WSme_o68J9p03~Hc%X#VcX!xAu%1`R!dfGJCp zV*&m47>s^%Ib0~-2f$6oSgn3jg8m%UA;ArcdcRyM5;}|r;)?a^D*lel5C`V5G=c~k zy*w_&BfySOxE!(~PI$*dwG><+-%KT5p?whOUMA*k<9*gi#T{h3DAxzAPxN&Xws8o9Cp*`PA5>d9*Z-ynV# z9yY*1WR^D8|C%I@vo+d8r^pjJ$>eo|j>XiLWvTWLl(^;JHCsoPgem6PvegHb-OTf| zvTgsHSa;BkbG=(NgPO|CZu9gUCGr$8*EoH2_Z#^BnxF0yM~t`|9ws_xZ8X8iZYqh! zAh;HXJ)3P&)Q0(&F>!LN0g#bdbis-cQxyGn9Qgh`q+~49Fqd2epikEUw9caM%V6WgP)532RMRW}8gNS%V%Hx7apSz}tn@bQy!<=lbhmAH=FsMD?leawbnP5BWM0 z5{)@EEIYMu5;u)!+HQWhQ;D3_Cm_NADNeb-f56}<{41aYq8p4=93d=-=q0Yx#knGYfXVt z+kMxlus}t2T5FEyCN~!}90O_X@@PQpuy;kuGz@bWft%diBTx?d)_xWd_-(!LmVrh**oKg!1CNF&LX4{*j|) zIvjCR0I2UUuuEXh<9}oT_zT#jOrJAHNLFT~Ilh9hGJPI1<5`C-WA{tUYlyMeoy!+U zhA#=p!u1R7DNg9u4|QfED-2TuKI}>p#2P9--z;Bbf4Op*;Q9LCbO&aL2i<0O$ByoI z!9;Ght733FC>Pz>$_mw(F`zU?`m@>gE`9_p*=7o=7av`-&ifU(^)UU`Kg3Kw`h9-1 z6`e6+im=|m2v`pN(2dE%%n8YyQz;#3Q-|x`91z?gj68cMrHl}C25|6(_dIGk*8cA3 zRHB|Nwv{@sP4W+YZM)VKI>RlB`n=Oj~Rzx~M+Khz$N$45rLn6k1nvvD^&HtsMA4`s=MmuOJID@$s8Ph4E zAmSV^+s-z8cfv~Yd(40Sh4JG#F~aB>WFoX7ykaOr3JaJ&Lb49=B8Vk-SQT9%7TYhv z?-Pprt{|=Y5ZQ1?od|A<_IJU93|l4oAfBm?3-wk{O<8ea+`}u%(kub(LFo2zFtd?4 zwpN|2mBNywv+d^y_8#<$r>*5+$wRTCygFLcrwT(qc^n&@9r+}Kd_u@Ithz(6Qb4}A zWo_HdBj#V$VE#l6pD0a=NfB0l^6W^g`vm^sta>Tly?$E&{F?TTX~DsKF~poFfmN%2 z4x`Dc{u{Lkqz&y!33;X}weD}&;7p>xiI&ZUb1H9iD25a(gI|`|;G^NwJPv=1S5e)j z;U;`?n}jnY6rA{V^ zxTd{bK)Gi^odL3l989DQlN+Zs39Xe&otGeY(b5>rlIqfc7Ap4}EC?j<{M=hlH{1+d zw|c}}yx88_xQr`{98Z!d^FNH77=u(p-L{W6RvIn40f-BldeF-YD>p6#)(Qzf)lfZj z?3wAMtPPp>vMehkT`3gToPd%|D8~4`5WK{`#+}{L{jRUMt zrFz+O$C7y8$M&E4@+p+oV5c%uYzbqd2Y%SSgYy#xh4G3hQv>V*BnuKQhBa#=oZB~w{azUB+q%bRe_R^ z>fHBilnRTUfaJ201czL8^~Ix#+qOHSO)A|xWLqOxB$dT2W~)e-r9;bm=;p;RjYahB z*1hegN(VKK+ztr~h1}YP@6cfj{e#|sS`;3tJhIJK=tVJ-*h-5y9n*&cYCSdg#EHE# zSIx=r#qOaLJoVVf6v;(okg6?*L_55atl^W(gm^yjR?$GplNP>BZsBYEf_>wM0Lc;T zhf&gpzOWNxS>m+mN92N0{;4uw`P+9^*|-1~$uXpggj4- z^SFc4`uzj2OwdEVT@}Q`(^EcQ_5(ZtXTql*yGzdS&vrS_w>~~ra|Nb5abwf}Y!uq6R5f&6g2ge~2p(%c< z@O)cz%%rr4*cRJ5f`n@lvHNk@lE1a*96Kw6lJ~B-XfJW%?&-y?;E&?1AacU@`N`!O z6}V>8^%RZ7SQnZ-z$(jsX`amu*5Fj8g!3RTRwK^`2_QHe;_2y_n|6gSaGyPmI#kA0sYV<_qOZc#-2BO%hX)f$s-Z3xlI!ub z^;3ru11DA`4heAu%}HIXo&ctujzE2!6DIGE{?Zs>2}J+p&C$rc7gJC35gxhflorvsb%sGOxpuWhF)dL_&7&Z99=5M0b~Qa;Mo!j&Ti_kXW!86N%n= zSC@6Lw>UQ__F&+&Rzv?gscwAz8IP!n63>SP)^62(HK98nGjLY2*e^OwOq`3O|C92? z;TVhZ2SK%9AGW4ZavTB9?)mUbOoF`V7S=XM;#3EUpR+^oHtdV!GK^nXzCu>tpR|89 zdD{fnvCaN^^LL%amZ^}-E+214g&^56rpdc@yv0b<3}Ys?)f|fXN4oHf$six)-@<;W&&_kj z-B}M5U*1sb4)77aR=@%I?|Wkn-QJVuA96an25;~!gq(g1@O-5VGo7y&E_srxL6ZfS z*R%$gR}dyONgju*D&?geiSj7SZ@ftyA|}(*Y4KbvU!YLsi1EDQQCnb+-cM=K1io78o!v*);o<XwjaQH%)uIP&Zm?)Nfbfn;jIr z)d#!$gOe3QHp}2NBak@yYv3m(CPKkwI|{;d=gi552u?xj9ObCU^DJFQp4t4e1tPzM zvsRIGZ6VF+{6PvqsplMZWhz10YwS={?`~O0Ec$`-!klNUYtzWA^f9m7tkEzCy<_nS z=&<(awFeZvt51>@o_~>PLs05CY)$;}Oo$VDO)?l-{CS1Co=nxjqben*O1BR>#9`0^ zkwk^k-wcLCLGh|XLjdWv0_Hg54B&OzCE^3NCP}~OajK-LuRW53CkV~Su0U>zN%yQP zH8UH#W5P3-!ToO-2k&)}nFe`t+mdqCxxAHgcifup^gKpMObbox9LFK;LP3}0dP-UW z?Zo*^nrQ6*$FtZ(>kLCc2LY*|{!dUn$^RW~m9leoF|@Jy|M5p-G~j%+P0_#orRKf8 zvuu5<*XO!B?1E}-*SY~MOa$6c%2cM+xa8}_8x*aVn~57v&W(0mqN1W`5a7*VN{SUH zXz98DDyCnX2EPl-`Lesf`=AQT%YSDb`$%;(jUTrNen$NPJrlpPDP}prI>Ml!r6bCT;mjsg@X^#&<}CGf0JtR{Ecwd&)2zuhr#nqdgHj+g2n}GK9CHuwO zk>oZxy{vcOL)$8-}L^iVfJHAGfwN$prHjYV0ju}8%jWquw>}_W6j~m<}Jf!G?~r5&Rx)!9JNX!ts#SGe2HzobV5); zpj@&`cNcO&q+%*<%D7za|?m5qlmFK$=MJ_iv{aRs+BGVrs)98BlN^nMr{V_fcl_;jkzRju+c-y?gqBC_@J0dFLq-D9@VN&-`R9U;nv$Hg?>$oe4N&Ht$V_(JR3TG^! zzJsbQbi zFE6-{#9{G{+Z}ww!ycl*7rRdmU#_&|DqPfX3CR1I{Kk;bHwF6jh0opI`UV2W{*|nn zf_Y@%wW6APb&9RrbEN=PQRBEpM(N1w`81s=(xQj6 z-eO0k9=Al|>Ej|Mw&G`%q8e$2xVz1v4DXAi8G};R$y)ww638Y=9y$ZYFDM$}vzusg zUf+~BPX>(SjA|tgaFZr_e0{)+z9i6G#lgt=F_n$d=beAt0Sa0a7>z-?vcjl3e+W}+ z1&9=|vC=$co}-Zh*%3588G?v&U7%N1Qf-wNWJ)(v`iO5KHSkC5&g7CrKu8V}uQGcfcz zmBz#Lbqwqy#Z~UzHgOQ;Q-rPxrRNvl(&u6ts4~0=KkeS;zqURz%!-ERppmd%0v>iRlEf+H$yl{_8TMJzo0 z>n)`On|7=WQdsqhXI?#V{>+~}qt-cQbokEbgwV3QvSP7&hK4R{Z{aGHVS3;+h{|Hz z6$Js}_AJr383c_+6sNR|$qu6dqHXQTc6?(XWPCVZv=)D#6_;D_8P-=zOGEN5&?~8S zl5jQ?NL$c%O)*bOohdNwGIKM#jSAC?BVY={@A#c9GmX0=T(0G}xs`-%f3r=m6-cpK z!%waekyAvm9C3%>sixdZj+I(wQlbB4wv9xKI*T13DYG^T%}zZYJ|0$Oj^YtY+d$V$ zAVudSc-)FMl|54n=N{BnZTM|!>=bhaja?o7s+v1*U$!v!qQ%`T-6fBvmdPbVmro&d zk07TOp*KuxRUSTLRrBj{mjsnF8`d}rMViY8j`jo~Hp$fkv9F_g(jUo#Arp;Xw0M$~ zRIN!B22~$kx;QYmOkos@%|5k)!QypDMVe}1M9tZfkpXKGOxvKXB!=lo`p?|R1l=tA zp(1}c6T3Fwj_CPJwVsYtgeRKg?9?}%oRq0F+r+kdB=bFUdVDRPa;E~~>2$w}>O>v=?|e>#(-Lyx?nbg=ckJ#5U6;RT zNvHhXk$P}m9wSvFyU3}=7!y?Y z=fg$PbV8d7g25&-jOcs{%}wTDKm>!Vk);&rr;O1nvO0VrU&Q?TtYVU=ir`te8SLlS zKSNmV=+vF|ATGg`4$N1uS|n??f}C_4Sz!f|4Ly8#yTW-FBfvS48Tef|-46C(wEO_%pPhUC5$-~Y?!0vFZ^Gu`x=m7X99_?C-`|h zfmMM&Y@zdfitA@KPw4Mc(YHcY1)3*1xvW9V-r4n-9ZuBpFcf{yz+SR{ zo$ZSU_|fgwF~aakGr(9Be`~A|3)B=9`$M-TWKipq-NqRDRQc}ABo*s_5kV%doIX7LRLRau_gd@Rd_aLFXGSU+U?uAqh z8qusWWcvgQ&wu{|sRXmv?sl=xc<$6AR$+cl& zFNh5q1~kffG{3lDUdvEZu5c(aAG~+64FxdlfwY^*;JSS|m~CJusvi-!$XR`6@XtY2 znDHSz7}_Bx7zGq-^5{stTRy|I@N=>*y$zz>m^}^{d&~h;0kYiq8<^Wq7Dz0w31ShO^~LUfW6rfitR0(=3;Uue`Y%y@ex#eKPOW zO~V?)M#AeHB2kovn1v=n^D?2{2jhIQd9t|_Q+c|ZFaWt+r&#yrOu-!4pXAJuxM+Cx z*H&>eZ0v8Y`t}8{TV6smOj=__gFC=eah)mZt9gwz>>W$!>b3O;Rm^Ig*POZP8Rl0f zT~o=Nu1J|lO>}xX&#P58%Yl z83`HRs5#32Qm9mdCrMlV|NKNC+Z~ z9OB8xk5HJ>gBLi+m@(pvpw)1(OaVJKs*$Ou#@Knd#bk+V@y;YXT?)4eP9E5{J%KGtYinNYJUH9PU3A}66c>Xn zZ{Bn0<;8$WCOAL$^NqTjwM?5d=RHgw3!72WRo0c;+houoUA@HWLZM;^U$&sycWrFd zE7ekt9;kb0`lps{>R(}YnXlyGY}5pPd9zBpgXeJTY_jwaJGSJQC#-KJqmh-;ad&F- z-Y)E>!&`Rz!HtCz>%yOJ|v(u7P*I$jqEY3}(Z-orn4 zlI?CYKNl`6I){#2P1h)y(6?i;^z`N3bxTV%wNvQW+eu|x=kbj~s8rhCR*0H=iGkSj zk23lr9kr|p7#qKL=UjgO`@UnvzU)`&fI>1Qs7ubq{@+lK{hH* zvl6eSb9%yngRn^T<;jG1SVa)eA>T^XX=yUS@NCKpk?ovCW1D@!=@kn;l_BrG;hOTC z6K&H{<8K#dI(A+zw-MWxS+~{g$tI7|SfP$EYKxA}LlVO^sT#Oby^grkdZ^^lA}uEF zBSj$weBJG{+Bh@Yffzsw=HyChS(dtLE3i*}Zj@~!_T-Ay7z=B)+*~3|?w`Zd)Co2t zC&4DyB!o&YgSw+fJn6`sn$e)29`kUwAc+1MND7YjV%lO;H2}fNy>hD#=gT ze+-aFNpyKIoXY~Vq-}OWPBe?Rfu^{ps8>Xy%42r@RV#*QV~P83jdlFNgkPN=T|Kt7 zV*M`Rh*30&AWlb$;ae130e@}Tqi3zx2^JQHpM>j$6x`#{mu%tZlwx9Gj@Hc92IuY* zarmT|*d0E~vt6<+r?W^UW0&#U&)8B6+1+;k^2|FWBRP9?C4Rk)HAh&=AS8FS|NQaZ z2j!iZ)nbEyg4ZTp-zHwVlfLC~tXIrv(xrP8PAtR{*c;T24ycA-;auWsya-!kF~CWZ zw_uZ|%urXgUbc@x=L=_g@QJ@m#5beS@6W195Hn7>_}z@Xt{DIEA`A&V82bc^#!q8$ zFh?z_Vn|ozJ;NPd^5uu(9tspo8t%&-U9Ckay-s@DnM*R5rtu|4)~e)`z0P-sy?)kc zs_k&J@0&0!q4~%cKL)2l;N*T&0;mqX5T{Qy60%JtKTQZ-xb%KOcgqwJmb%MOOKk7N zgq})R_6**{8A|6H?fO+2`#QU)p$Ei2&nbj6TpLSIT^D$|`TcSeh+)}VMb}LmvZ{O| ze*1IdCt3+yhdYVxcM)Q_V0bIXLgr6~%JS<<&dxIgfL=Vnx4YHuU@I34JXA|+$_S3~ zy~X#gO_X!cSs^XM{yzDGNM>?v(+sF#<0;AH^YrE8smx<36bUsHbN#y57K8WEu(`qHvQ6cAZPo=J5C(lSmUCZ57Rj6cx!e^rfaI5%w}unz}4 zoX=nt)FVNV%QDJH`o!u9olLD4O5fl)xp+#RloZlaA92o3x4->?rB4`gS$;WO{R;Z3>cG3IgFX2EA?PK^M}@%1%A;?f6}s&CV$cIyEr#q5;yHdNZ9h{| z-=dX+a5elJoDo?Eq&Og!nN6A)5yYpnGEp}?=!C-V)(*~z-+?kY1Q7qs#Rsy%hu_60rdbB+QQNr?S1 z?;xtjUv|*E3}HmuNyB9aFL5H~3Ho0UsmuMZELp1a#CA1g`P{-mT?BchuLEtK}!QZ=3AWakRu~?f9V~3F;TV`5%9Pcs_$gq&CcU}r8gOO zC2&SWPsSG{&o-LIGTBqp6SLQZPvYKp$$7L4WRRZ0BR$Kf0I0SCFkqveCp@f)o8W)! z$%7D1R`&j7W9Q9CGus_)b%+B#J2G;l*FLz#s$hw{BHS~WNLODV#(!u_2Pe&tMsq={ zdm7>_WecWF#D=?eMjLj=-_z`aHMZ=3_-&E8;ibPmM}61i6J3is*=dKf%HC>=xbj4$ zS|Q-hWQ8T5mWde6h@;mS+?k=89?1FU<%qH9B(l&O>k|u_aD|DY*@~(`_pb|B#rJ&g zR0(~(68fpUPz6TdS@4JT5MOPrqDh5_H(eX1$P2SQrkvN8sTxwV>l0)Qq z0pzTuvtEAKRDkKGhhv^jk%|HQ1DdF%5oKq5BS>szk-CIke{%js?~%@$uaN3^Uz6Wf z_iyx{bZ(;9y4X&>LPV=L=d+A}7I4GkK0c1Xts{rrW1Q7apHf-))`BgC^0^F(>At1* za@e7{lq%yAkn*NH8Q1{@{lKhRg*^TfGvv!Sn*ed*x@6>M%aaqySxR|oNadYt1mpUZ z6H(rupHYf&Z z29$5g#|0MX#aR6TZ$@eGxxABRKakDYtD%5BmKp;HbG_ZbT+=81E&=XRk6m_3t9PvD zr5Cqy(v?gHcYvYvXkNH@S#Po~q(_7MOuCAB8G$a9BC##gw^5mW16cML=T=ERL7wsk zzNEayTG?mtB=x*wc@ifBCJ|irFVMOvH)AFRW8WE~U()QT=HBCe@s$dA9O!@`zAAT) zaOZ7l6vyR+Nk_OOF!ZlZmjoImKh)dxFbbR~z(cMhfeX1l7S_`;h|v3gI}n9$sSQ>+3@AFAy9=B_y$)q;Wdl|C-X|VV3w8 z2S#>|5dGA8^9%Bu&fhmVRrTX>Z7{~3V&0UpJNEl0=N32euvDGCJ>#6dUSi&PxFW*s zS`}TB>?}H(T2lxBJ!V#2taV;q%zd6fOr=SGHpoSG*4PDaiG0pdb5`jelVipkEk%FV zThLc@Hc_AL1#D&T4D=w@UezYNJ%0=f3iVRuVL5H?eeZM}4W*bomebEU@e2d`M<~uW zf#Bugwf`VezG|^Qbt6R_=U0}|=k;mIIakz99*>FrsQR{0aQRP6ko?5<7bkDN8evZ& zB@_KqQG?ErKL=1*ZM9_5?Pq%lcS4uLSzN(Mr5=t6xHLS~Ym`UgM@D&VNu8e?_=nSFtF$u@hpPSmI4Vo_t&v?>$~K4y(O~Rb*(MFy_igM7 z*~yYUyR6yQgzWnWMUgDov!!g=lInM+=lOmOk4L`O?{i&qxy&D*_qorRbDwj6?)!ef z#JLd7F6Z2I$S0iYI={rZNk*<{HtIl^mx=h>Cim*04K4+Z4IJtd*-)%6XV2(MCscPiw_a+y*?BKbTS@BZ3AUao^%Zi#PhoY9Vib4N>SE%4>=Jco0v zH_Miey{E;FkdlZSq)e<{`+S3W=*ttvD#hB8w=|2aV*D=yOV}(&p%0LbEWH$&@$X3x~CiF-?ejQ*N+-M zc8zT@3iwkdRT2t(XS`d7`tJQAjRmKAhiw{WOqpuvFp`i@Q@!KMhwKgsA}%@sw8Xo5Y=F zhRJZg)O4uqNWj?V&&vth*H#je6T}}p_<>!Dr#89q@uSjWv~JuW(>FqoJ5^ho0%K?E z9?x_Q;kmcsQ@5=}z@tdljMSt9-Z3xn$k)kEjK|qXS>EfuDmu(Z8|(W?gY6-l z@R_#M8=vxKMAoi&PwnaIYw2COJM@atcgfr=zK1bvjW?9B`-+Voe$Q+H$j!1$Tjn+* z&LY<%)L@;zhnJlB^Og6I&BOR-m?{IW;tyYC%FZ!&Z>kGjHJ6cqM-F z&19n+e1=9AH1VrVeHrIzqlC`w9=*zfmrerF?JMzO&|Mmv;!4DKc(sp+jy^Dx?(8>1 zH&yS_4yL7m&GWX~mdfgH*AB4{CKo;+egw=PrvkTaoBU+P-4u?E|&!c z)DKc;>$$B6u*Zr1SjUh2)FeuWLWHl5TH(UHWkf zLs>7px!c5n;rbe^lO@qlYLzlDVp(z?6rPZel=YB)Uv&n!2{+Mb$-vQl=xKw( zve&>xYx+jW_NJh!FV||r?;hdP*jOXYcLCp>DOtJ?2S^)DkM{{Eb zS$!L$e_o0(^}n3tA1R3-$SNvgBq;DOEo}fNc|tB%%#g4RA3{|euq)p+xd3I8^4E&m zFrD%}nvG^HUAIKe9_{tXB;tl|G<%>yk6R;8L2)KUJw4yHJXUOPM>(-+jxq4R;z8H#>rnJy*)8N+$wA$^F zN+H*3t)eFEgxLw+Nw3};4WV$qj&_D`%ADV2%r zJCPCo%{=z7;`F98(us5JnT(G@sKTZ^;2FVitXyLe-S5(hV&Ium+1pIUB(CZ#h|g)u zSLJJ<@HgrDiA-}V_6B^x1>c9B6%~847JkQ!^KLZ2skm;q*edo;UA)~?SghG8;QbHh z_6M;ouo_1rq9=x$<`Y@EA{C%6-pEV}B(1#sDoe_e1s3^Y>n#1Sw;N|}8D|s|VPd+g z-_$QhCz`vLxxrVMx3ape1xu3*wjx=yKSlM~nFgkNWb4?DDr*!?U)L_VeffF<+!j|b zZ$Wn2$TDv3C3V@BHpSgv3JUif8%hk%OsGZ=OxH@8&4`bbf$`aAMchl^qN>Eyu3JH} z9-S!x8-s4fE=lad%Pkp8hAs~u?|uRnL48O|;*DEU! zuS0{cpk%1E0nc__2%;apFsTm0bKtd&A0~S3Cj^?72-*Owk3V!ZG*PswDfS~}2<8le z5+W^`Y(&R)yVF*tU_s!XMcJS`;(Tr`J0%>p=Z&InR%D3@KEzzI+-2)HK zuoNZ&o=wUC&+*?ofPb0a(E6(<2Amd6%uSu_^-<1?hsxs~0K5^f(LsGqgEF^+0_H=uNk9S0bb!|O8d?m5gQjUKevPaO+*VfSn^2892K~%crWM8+6 z25@V?Y@J<9w%@NXh-2!}SK_(X)O4AM1-WTg>sj1{lj5@=q&dxE^9xng1_z9w9DK>| z6Iybcd0e zyi;Ew!KBRIfGPGytQ6}z}MeXCfLY0?9%RiyagSp_D1?N&c{ zyo>VbJ4Gy`@Fv+5cKgUgs~na$>BV{*em7PU3%lloy_aEovR+J7TfQKh8BJXyL6|P8un-Jnq(ghd!_HEOh$zlv2$~y3krgeH;9zC}V3f`uDtW(%mT#944DQa~^8ZI+zAUu4U(j0YcDfKR$bK#gvn_{JZ>|gZ5+)u?T$w7Q%F^;!Wk?G z(le7r!ufT*cxS}PR6hIVtXa)i`d$-_1KkyBU>qmgz-=T};uxx&sKgv48akIWQ89F{ z0XiY?WM^~;|T8zBOr zs#zuOONzH?svv*jokd5SK8wG>+yMC)LYL|vLqm^PMHcT=`}V$=nIRHe2?h)8WQa6O zPAU}d`1y(>kZiP~Gr=mtJLMu`i<2CspL|q2DqAgAD^7*$xzM`PU4^ga`ilE134XBQ z99P(LhHU@7qvl9Yzg$M`+dlS=x^(m-_3t|h>S}E0bcFMn=C|KamQ)=w2^e)35p`zY zRV8X?d;s^>Cof2SPR&nP3E+-LCkS0J$H!eh8~k0qo$}00b=7!H_I2O+Ro@3O$nPdm ztmbOO^B+IHzQ5w>@@@J4cKw5&^_w6s!s=H%&byAbUtczPQ7}wfTqxxtQNfn*u73Qw zGuWsrky_ajPx-5`R<)6xHf>C(oqGf_Fw|-U*GfS?xLML$kv;h_pZ@Kk$y0X(S+K80 z6^|z)*`5VUkawg}=z`S;VhZhxyDfrE0$(PMurAxl~<>lfZa>JZ288ULK7D` zl9|#L^JL}Y$j*j`0-K6kH#?bRmg#5L3iB4Z)%iF@SqT+Lp|{i`m%R-|ZE94Np7Pa5 zCqC^V3}B(FR340pmF*qaa}M}+h6}mqE~7Sh!9bDv9YRT|>vBNAqv09zXHMlcuhKD| zcjjA(b*XCIwJ33?CB!+;{)vX@9xns_b-VO{i0y?}{!sdXj1GM8+$#v>W7nw;+O_9B z_{4L;C6ol?(?W0<6taGEn1^uG=?Q3i29sE`RfYCaV$3DKc_;?HsL?D_fSYg}SuO5U zOB_f4^vZ_x%o`5|C@9C5+o=mFy@au{s)sKw!UgC&L35aH(sgDxRE2De%(%OT=VUdN ziVLEmdOvJ&5*tCMKRyXctCwQu_RH%;m*$YK&m;jtbdH#Ak~13T1^f89tn`A%QEHWs~jnY~E}p_Z$XC z=?YXLCkzVSK+Id`xZYTegb@W8_baLt-Fq`Tv|=)JPbFsKRm)4UW;yT+J`<)%#ue9DPOkje)YF2fsCilK9MIIK>p*`fkoD5nGfmLwt)!KOT+> zOFq*VZktDDyM3P5UOg`~XL#cbzC}eL%qMB=Q5$d89MKuN#$6|4gx_Jt0Gfn8w&q}%lq4QU%6#jT*MRT% zrLz~C8FYKHawn-EQWN1B75O&quS+Z81(zN)G>~vN8VwC+e+y(`>HcxC{MrJ;H1Z4k zZWuv$w_F0-Ub%MVcpIc){4PGL^I7M{>;hS?;eH!;gmcOE66z3;Z1Phqo(t zVP(Hg6q#0gIKgsg7L7WE!{Y#1nI(45tx2{$34dDd#!Z0NIyrm)HOn5W#7;f4pQci# zDW!FI(g4e668kI9{2+mLwB+=#9bfqgX%!B34V-$wwSN(_cm*^{y0jQtv*4}eO^sOV z*9xoNvX)c9isB}Tgx&ZRjp3kwhTVK?r9;n!x>^XYT z@Q^7zp{rkIs{2mUSE^2!Gf6$6;j~&4=-0cSJJDizZp6LTe8b45;{AKM%v99}{{FfC zz709%u0mC=1KXTo(=TqmZQ;c?$M3z(!xah>aywrj40sc2y3rKFw4jCq+Y+u=CH@_V zxz|qeTwa>+<|H%8Dz5u>ZI5MmjTFwXS-Fv!TDd*`>3{krWoNVx$<133`(ftS?ZPyY z&4@ah^3^i`vL$BZa>O|Nt?ucewzsF)0zX3qmM^|waXr=T0pfIb0*$AwU=?Ipl|1Y; z*Pk6{C-p4MY;j@IJ|DW>QHZQJcp;Z~?8(Q+Kk3^0qJ}SCk^*n4W zu9ZFwLHUx-$6xvaQ)SUQcYd6fF8&x)V`1bIuX@>{mE$b|Yd(qomn3;bPwnDUc0F=; zh*6_((%bqAYQWQ~odER?h>1mkL4kpb3s7`0m@rDKGU*oyF)$j~Ffd4fXV$?`f~rHf zB%Y)@5SXZvfwm10RY5X?TEo)PK_`L6qgBp=#>fO49$D zDq8Ozj0q6213tV5Qq=;fZ0$|KroY{Dz=l@lU^J)?Ko@ti20TRplXzphBi>XGx4bou zEWrkNjz0t5j!_ke{g5I#PUlEU$Km8g8TE|XK=MkU@PT4T><2OVamoK;wJ}3X0L$vX zgd7gNa359*nc)R-0!`2X@FOTB`+oETOPc=ubp5R)VQgY+5BTZZJ2?9QwnO=dnulIUF3gFn;BODC2)65)HeVd%t86sL7Rv^Y+nbn+&l z6BAJY(ETvwI)Ts$aiE8rht4KD*qNyE{8{x6R|%akbTBzw;2+6Echkt+W+`u^XX z_z&x%nnW$ZR+`W ze|#J8f4A@M|F5BpfUJb5h>|j$jOe}0oE!`Zf6fM>CR?!y@zU(cL8NsKk`a z6tx5mAkdjD;J=LcJ;;Aw8p!v#ouk>mUDZF@ zK>yvw%+bKu+T{Nk@LZ;zkYy0HBKw06_IWcMHo*0HKpTsEFZhn5qCHH9j z)|XpN&{`!0a>Vl+PmdQc)Yg4A(AG-z!+@Q#eHr&g<9D?7E)_aEB?s_rx>UE9TUq|? z;(ggJt>9l?C|zoO@5)tu?EV0x_7T17q4fF-q3{yZ^ipUbKcRZ4Qftd!xO(#UGhb2y>?*@{xq%`(-`2T^vc=#< zx!+@4pRdk&*1ht2OWk^Z5IAQ0YTAXLkL{(D*$gENaD)7A%^XXrCchN&z2x+*>o2FwPFjWpeaL=!tzv#JOW#( z$B)Nel<+$bkH1KZv3&-}=SiG~w2sbDbAWarg%5>YbC|}*d9hBjBkR(@tyM0T)FO$# zPtRXukGPnOd)~z=?avu+4Co@wF}1T)-uh5jI<1$HLtyDrVak{gw`mcH@Q-@wg{v^c zRzu}hMKFHV<8w}o*yg6p@Sq%=gkd~;`_VGTS?L@yVu`xuGy+dH6YOwcP6ZE`_0rK% zAx5!FjDuss`FQ3eF|mhrWkjux(Pny^k$u_)dyCSEbAsecHsq#8B3n3kDU(zW5yE|( zgc>sFQywFj5}U*qtF9Y(bi*;>B7WJykcAXF86@)z|0-Vm@jt!EPoLA6>r)?@DIobIZ5Sx zsc@OC{b|3%vaMbyeM|O^UxEYlEMHK4r)V-{r)_yz`w1*xV0|lh-LQOP`OP`Pk1aW( z8DSlGN>Ts|n*xj+%If~+E_BxK)~5T#w6Q1WEKt{!Xtbd`J;`2a>8boRo;7u2M&iOop4qcy<)z023=oghSFV zST;?S;ye+dRQe>ygiJ6HCv4;~3DHtJ({fWeE~$H@mKn@Oh6Z(_sO>01JwH5oA4nvK zr5Sr^g+LC zLt(i&ecdmqsIJGNOSUyUpglvhhrY8lGkzO=0USEKNL%8zHshS>Qziu|`eyWP^5xL4 zRP122_dCJl>hZc~?58w~>`P_s18VoU|7(|Eit0-lZRgLTZKNq5{k zE?V=`7=R&ro(X%LTS*f+#H-mGo_j3dm@F_krAYegDLk6UV{`UKE;{YSsn$ z(yz{v1@p|p!0>g04!eRSrSVb>MQYPr8_MA|MpoGzqyd*$@4j|)cD_%^Hrd>SorF>@ zBX+V<@vEB5PRLGR(uP9&U&5=(HVc?6B58NJT_igiAH*q~Wb`dDZpJSKfy5#Aag4IX zj~uv74EQ_Q_1qaXWI!7Vf@ZrdUhZFE;L&P_Xr8l@GMkhc#=plV0+g(ki>+7fO%?Jb zl+bTy7q{w^pTb{>(Xf2q1BVdq?#f=!geqssXp z4pMu*q;iiHmA*IjOj4`4S&|8@gSw*^{|PT}Aw~}ZXU`6=vZB=GGeMm}V6W46|pU&58~P+?LUs%n@J}CSrICkeng6YJ^M? zS(W?K4nOtoBe4tvBXs@@`i?4G$S2W&;$z8VBSM;Mn9 zxcaEiQ9=vS|bIJ>*tf9AH~m&U%2+Dim<)E=}KORp+cZ^!@wI`h1NVBXu{@%hB2Cq(dXx_aQ9x3mr*fwL5!ZryQqi|KFJuzvP zK1)nrKZ7U+B{1ZmJub?4)Ln^J6k!i0t~VO#=q1{?T)%OV?MN}k5M{}vjyZu#M0_*u z8jwZKJ#Df~1jcLXZL7bnCEhB6IzQZ-GcoQJ!16I*39iazoVGugcKA{lhiHg4Ta2fD zk1Utyc5%QzZ$s3;p0N+N8VX{sd!~l*Ta3|t>lhI&G`sr6L~G5Lul`>m z{!^INm?J|&7X=;{XveF!(b*=?9NAp4y&r&N3(GKcW4rS(Ejk|Lzs1PrxPI_owB-`H zg3(Rruh^&)`TKA6+_!n>RdI6pw>Vt1_j&+bKIaMTYLiqhZ#y_=J8`TK{Jd<7l9&sY z^^`hmi7^14s16B6)1O;vJWOF$=$B5ONW;;2&|pUvJlmeUS&F;DbSHCrEb0QBDR|my zIs+pE0Y^`qJTyH-_mP=)Y+u^LHcuZhsM3+P||?+W#V!_6E-8boP#R-*na4!o-Q1 zVthtYhK{mDhF(&7Okzo9dTi03X(AE{8cH$JIg%MEQca`S zy@8{Fjft~~BdzWC(di#X{ny;!yYGK9b@=b|zcKZ{vv4D8i+`ilOPl;PJl{!&5-0!w z^fOl#|}vVg%=n)@_e1BrP)`A zKPgs`O0EO}Y2KWLuo`iGaKu1k#YR6BMySxQf2V++Wo{6EHmK>A~Q5o73yM z-RbxC7Qdh0Cz!nG+7BRZE>~FLI-?&W_rJUl-8FDIaXoNBL)@1hwKa^wOr1($*5h~T zF;%f^%<$p8Y_yu(JEg=c_O!aZ#)Gjh$n(hfJAp$C2he555W5zdrBqjFmo|VY+el;o z=*D_w|GXG|p0**hQ7~9-n|y5k%B}TAF0iarDM!q-jYbR^us(>&y;n^2l0C%@2B}KM zyeRT9)oMt97Agvc4sEKUEy%MpXr2vz*lb zh*L}}iG>-pqDRw7ud{=FvTD?}xjD)w{`KzjNom-$jS^;iw0+7nXSnt1R@G|VqoRhE%12nm+PH?9`(4rM0kfrZzIK9JU=^$YNyLvAIoxl#Q)xxDz!^0@zZ zSCs$nfcxK_vRYM34O<1}QHZ|hp4`ioX3x8(UV(FU$J@o%tw3t4k1QPmlEpZa2IujG&(roX_q*%e`Hq|);0;@k z0z=fZiFckp#JzW0p+2A+D$PC~IsakhJJkG(c;CqAgFfU0Z`u$PzG~-9I1oPHrCw&)@s^Dc~^)#HPW0Ra}J^=|h7Fs*<8|b13ZzG6MP*Q1dkoZ6&A^!}|hbjM{2HpqlSXv_UUg1U4gn z3Q)2VjU^ti1myodv+tjhSZp%D978m~p& z43uZUrraHs80Mq&vcetqfQpQP?m!CFj)44t8Z}k`E798wxg&~aCm+DBoI+nKq}&j^ zlPY3W$)K;KtEajks1`G?-@me7C>{PiiBu+41#yU_c(dITaqE?IQ(DBu+c^Ux!>pCj zLC|HJGU*v+!it1(;3e`6igkH(VA)-S+k(*yqxMgUah3$@C zz`7hEM47xr>j8^g`%*f=6S5n>z%Bt_Fg{Tvmr+MIsCx=0gsu_sF`q2hlkEmisz#Fy zj_0;zUWr;Gz}$BS%Y`meb(=$d%@Crs(OoJ|}m#<7=-A~PQbyN$x%2iXP2@e*nO0b7AwfH8cCUa*Wfu@b)D_>I*%uE4O3 z(lfnB`-Xf*LfC)E}e?%X2kK7DItK6Tf<+M^mX0Ijf_!IP>7c8IZX%8_#0060P{QMuV^B9i<^E`_Qf0pv9(P%_s8D`qvDE9LK9u-jB}J2S`(mCO&XHTS04Z5Ez*vl^T%!^$~EH8M-UdwhegL>3IQ*)(MtuH2Xt1p!fS4o~*rR?WLxlA!sjc2(O znjJn~wQ!Fp9s2e^IWP1C<4%sFF}T4omr}7+4asciyo3DntTgWIzhQpQirM$9{EbQd z3jz9vS@{aOqTQHI|l#aUV@2Q^Wko4T0T04Me4!2nsdrA8QY1%fnAYb~d2GDz@lAtfcHq(P7 zaMBAGo}+NcE-K*@9y;Vt3*(aCaMKXBB*BJcD_Qnxpt75r?GeAQ}*|>pYJE=uZb73 zC>sv)18)q#EGrTG6io*}JLuB_jP3AU1Uiu$D7r|2_zlIGb9 zjhst#ni)Y`$)!fc#reM*$~iaYoz~_Cy7J3ZTiPm)E?%`fbk`3Tu-F#`{i!l5pNEn5 zO-Tw-=TojYhzT{J=?SZj=Z8#|eoF>434b-DXiUsignxXNaR3 zm_}4iWU$gt2Mw5NvZ5(VpF`?X*f2UZDs1TEa1oZCif?Jdgr{>O~7}-$|BZ7I(IKW`{f;@|IZFX*R8&iT= zoWstN8&R;}@2Ka%d3vrLtR|O??ben;k8QbS-WB0VgiCz;<$pBmIZdN!aalyCSEm)crpS9dcD^Y@XT1a3+zpi-`D}e#HV<} z$Y(G&o~PvL-xSVD5D?JqF3?B9rxGWeb=oEGJ3vRp5xfBPlngh1O$yI95EL+T8{GC@ z98i1H9KhZGFl|;`)_=QpM6H?eDPpw~^(aFQWwyXZ8_EEE4#@QeT_URray*mEOGsGc z6|sdXtq!hVZo=d#+9^@lm&L5|q&-GDCyUx#YQiccq;spOBe3V+VKdjJA=IL=Zn%P} zNk=_8u}VhzFf{UYZV0`lUwcD&)9AFx0@Fc6LD9A6Rd1=ga>Mi0)_QxM2ddCVRmZ0d z+J=uXc(?5JLX3=)e)Jm$HS2yF`44IKhwRnm2*669_J=2LlwuF5$1tAo@ROSU@-y+;Foy2IEl2^V1N;fk~YR z?&EP8#t&m0B=?aJeuz~lHjAzRBX>&x=A;gIvb>MD{XEV zV%l-+9N-)i;YH%nKP?>f`=?#`>B(`*t`aiPLoQM(a6(qs4p5KFjDBN?8JGrf3z8>= zi7sD)c)Nm~x{e<^jy4nTx${P~cwz_*a>%0_;ULou3kHCAD7EYkw@l$8TN#LO9jC( z1BeFW`k+bu5e8Ns^a8dPcjEVHM;r6UX+cN=Uy7HU)j-myRU0wHd$A1fNI~`4;I~`zC)3ul#8#^rXVSO*m}Ag>c%_;nj=Nv$rCZ z*~L@C@OZg%Q^m)lc-kcX&a*a5`y&DaRxh6O*dfhLfF+fU5wKs(1v*!TkZidw*)YBP za@r`3+^IHRFeO%!ai%rxy;R;;V^Fr=OJlpBX;(b*3+SIw}7= zIq$*Thr(Zft-RlY)D3e8V;BmD&HOfX+E$H#Y@B3?UL5L~_fA-@*IB-!gItK7PIgG9 zgWuGZK_nuZjHVT_Fv(XxtU%)58;W39vzTI2n&)&4Dmq7&JX6G>XFaAR{7_3QB6zsT z?$L8c*WdN~nZGiscY%5KljQARN;`w$gho=p006z;n(qIQ*Zu<``TMO3n0{ARL@gYh zoRwS*|Niw~cR!?hE{m*y@F`1)vx-JRfqET=dJ5_(076st(=lFfjtKHoYg`k3oNmo_ zNbQEw8&sO5jAYmkD|Zaz_yUb0rC})U!rCHOl}JhbYIDLzLvrZVw0~JO`d*6f;X&?V=#T@ND*cv^I;`sFeq4 z##H5;gpZTb^0Hz@3C*~u0AqqNZ-r%rN3KD~%Gw`0XsIq$(^MEb<~H(2*5G^<2(*aI z%7}WB+TRlMIrEK#s0 z93xn*Ohb=kWFc)BNHG4I(~RPn-R8#0lqyBBz5OM6o5|>x9LK@%HaM}}Y5goCQRt2C z{j*2TtT4ne!Z}vh89mjwiSXG=%DURar~=kGNNaO_+Nkb+tRi~Rkf!7a$*QlavziD( z83s4GmQ^Wf*0Bd04f#0HX@ua_d8 z23~z*53ePD6@xwZ(vdl0DLc=>cPIOPOdca&MyR^jhhKrdQO?_jJh`xV3GKz&2lvP8 zEOwW6L*ufvK;TN{=S&R@pzV^U=QNk^Ec}5H z+2~JvEVA{`uMAr)?Kf|aW>33`)UL@bnfIUQc~L;TsTQ6>r-<^rB8uoNOJ>HWgqMI8 zSW}pZmp_;z_2O5_RD|fGyTxaxk53Hg_3Khc<8AUzV|ZeK{fp|Ne933=1&_^Dbv5^u zB9n=*)k*tjHDRJ@$bp9mrh}qFn*s}npMl5BMDC%Hs0M0g-hW~P*3CNG06G!MOPEQ_ zi}Qs-6M8aMt;sL$vlmVBR^+Ry<64jrm1EI1%#j?c?4b*7>)a{aDw#TfTYKq+SjEFA z(aJ&z_0?0JB83D-i3Vh+o|XV4UP+YJ$9Boid2^M2en@APw&wx7vU~t$r2V`F|7Qfo z>WKgI@eNBZ-+Og<{u2ZiG%>YvH2L3fNpV9J;WLJoBZda)01Rn;o@){01{7E#ke(7U zHK>S#qZ(N=aoae*4X!0A{)nu0R_sKpi1{)u>GVjC+b5Jyl6#AoQ-1_3UDovNSo`T> z?c-@7XX*2GMy?k?{g)7?Sv;SJkmxYPJPs!&QqB12ejq`Lee^-cDveVWL^CTUldb(G zjDGe(O4P=S{4fF=#~oAu>LG>wrU^z_?3yt24FOx>}{^lCGh8?vtvY$^hbZ)9I0E3r3NOlb9I?F-Yc=r$*~l`4N^xzlV~N zl~#oc>U)Yjl0BxV>O*Kr@lKT{Z09OXt2GlvE38nfs+DD7exl|&vT;)>VFXJVZp9Np zDK}aO;R3~ag$X*|hRVY3OPax|PG`@_ESc8E!mHRByJbZQRS38V2F__7MW~sgh!a>98Q2%lUNFO=^xU52|?D=IK#QjwBky-C>zOWlsiiM&1n z;!&1((Xn1$9K}xabq~222gYvx3hnZPg}VMF_GV~5ocE=-v>V=T&RsLBo&`)DOyIj* zLV{h)JU_y*7SdRtDajP_Y+rBkNN*1_TXiKwHH2&p51d(#zv~s#HwbNy?<+(=9WBvo zw2hkk2Dj%kTFhY+$T+W-b7@qD!bkfN#Z2ng@Pd=i3-i?xYfs5Z*1hO?kd7Sp^9`;Y zM2jeGg<-nJD1er@Pc_cSY7wo5dzQX44=%6rn}P_SRbpzsA{6B+!$3B0#;}qwO37G^ zL(V_5JK`XT?OHVk|{_$vQ|oNEpab*BO4F zUTNQ7RUhnRsU`TK#~`)$icsvKh~(pl=3p6m98@k3P#~upd=k*u20SNcb{l^1rUa)>qO997)pYRWMncC8A&&MHlbW?7i^7M`+B$hH~Y|J zd>FYOGQ;j>Zc2e7R{KK7)0>>nn_jYJy&o@sK!4G>-rLKM8Hv)f;hi1D2fAc$+six2 zyVZ@wZ6x|fJ!4KrpCJY=!Mq0;)X)OoS~{Lkh6u8J`eK%u0WtKh6B>GW_)PVc zl}-k`p09qwGtZ@VbYJC!>29V?Dr>>vk?)o(x?!z*9DJ||9qG-&G~#kXxbw{KKYy}J zQKa-dPt~M~E}V?PhW0R26xdA%1T*%ra6SguGu50YHngOTIv)@N|YttEXo#OZfgtP7;H?EeZZxo<}3YlYxtBq znJ!WFR^tmGf0Py}N?kZ(#=VtpC@%xJkDmfcCoBTxq zr_|5gP?u1@vJZbxPZ|G0AW4=tpb84gM2DpJU||(b8kMOV1S3|(yuwZJ&rIiFW(U;5 zUtAW`O6F6Zy+eZ1EDuP~AAHlSY-+A_eI5Gx)%*uro5tljy}kCZU*_d7)oJ>oQSZ3* zneTn`{gnNC&uJd)0aMBzAg021?YJ~b(fmkwZAd696a=0NzBAqBN54KuNDwa*no(^O z6p05bioXUR^uXjpTol*ppHp%1v9e)vkoUAUJyBx3lw0UO39b0?^{}yb!$yca(@DUn zCquRF?t=Zb9`Ed3AI6|L{eX~ijVH`VzSMheKoP7LSSf4g>md>`yi!TkoG5P>Ofp+n z(v~rW+(5L96L{vBb^g51B=(o)?%%xhvT*A5btOpw(TKh^g^4c zw>0%X!_0`{iN%RbVk+A^f{w-4-SSf*fu@FhruNL##F~sF24O~u zyYF<3el2b$$wZ_|uW#@Ak+VAGk#e|kS8nL1g>2B-SNMjMp^8;-FfeofY2fphFHO!{ z*!o4oTb{4e;S<|JEs<1_hPsmAlVNk?_5-Fp5KKU&d#FiNW~Y+pVFk@Cua1I{T+1|+ zHx6rFMor)7L)krbilqsWwy@T+g3DiH5MyVf8Wy}XbEaoFIDr~y;@r&I>FMW{ z?Q+(IgyebZ)-i4jNoXQhq4Muy9Fv+OxU;9_Jmn+<`mEC#%2Q_2bpcgzcinygNI!&^ z=V$)o2&Yz04~+&pPWWn`rrWxJ&}8khR)6B(--!9Q zubo}h+1T)>a@c)H^i``@<^j?|r4*{;tQf78(xn0g39IoZw0(CwY1f<%F>kEaJ zp9u|IeMY5mRdAlw*+gSN^5$Q)ShM<~E=(c8QM+T-Qk)FyKz#Sw0EJ*edYcuOtO#~Cx^(M7w5 z3)rl#L)rF|(Vun2LkFr!rg8Q@=r>9p>(t3Gf_auiJ2Xx9HmxYTa|=MH_SUlYL`mz9 zTTS$`%;D-|Jt}AP1&k7PcnfFNTH0A-*FmxstjBDiZX?}%u%Yq94$fUT&z6od+(Uk> zuqsld#G(b$G8tus=M!N#oPd|PVFX)?M?tCD0tS%2IGTfh}3YA3f&UM)W$_GNV8 zQo+a(ml2Km4o6O%gKTCSDNq+#zCTIQ1*`TIJh~k6Gp;htHBFnne))rlFdGqwC6dx2+La1&Mnko*352k0y z+tQcwndQlX`nc6nb$A9?<-o|r*%aWXV#=6PQic0Ok_D;q>wbv&j7cKc!w4~KF#-{6 z(S%6Za)WpGIWf7jZ3svNG5OLs0>vCL9{V7cgO%zevIVMH{WgP*^D9ws&OqA{yr|m| zKD4*07dGXshJHd#e%x%J+qmS^lS|0Bp?{drv;{@{l9ArPO&?Q5=?OO9=}h$oVe#3b z3Yofj&Cb}WC$PxmRRS)H%&$1-)z7jELS}!u!zQ?A^Y{Tv4QVt*vd@uj-^t2fYRzQj zfxGR>-q|o$3sGn^#VzZ!QQx?h9`njeJry}@x?|k0-GTTA4y3t2E`3DZ!A~D?GiJup z)8%PK2^9OVRlP(24P^4_<|D=H^7}WlWu#LgsdHzB%cPy|f8dD3|A^mh4WXxhLTVu_ z@abE{6Saz|Y{rXYPd4$tfPYo}ef(oQWZ=4Bct-=_9`#Qgp4ma$n$`tOwq#&E18$B; z@Bp)bn3&rEi0>fWWZ@7k5WazfoX`SCO4jQWwVuo+$PmSZn^Hz?O(-tW@*DGxuf)V1 zO_xm&;NVCaHD4dqt(-MlszI3F-p?0!-e$fbiCeuaw66h^TTDLWuaV<@C-`=Xe5WL) zwooG7h>4&*)p3pKMS3O!4>-4jQUN}iAMQ)2*70?hP~)TzzR?-f@?Aqy$$1Iy8VGG$ zMM?8;j!pUX7QQD$gRc_#+=raAS577ga-w?jd`vCiN5lu)dEUkkUPl9!?{$IJNxQys z*E4e$eF&n&+AMRQR2gcaFEjAy*r)G!s(P6D&TfoApMFC_*Ftx0|D0@E-=B7tezU@d zZ{hGiN;YLIoSeRS;9o%dEua4b%4R3;$SugDjP$x;Z!M!@QibuSBb)HY!3zJ7M;^jw zlx6AD50FD&p3JyP*>o+t9YWW8(7P2t!VQQ21pHJOcG_SXQD;(5aX#M6x##5H_Re>6lPyDCjxr*R(+HE%c&QN+b^tbT zXBJk?p)zhJj#I?&Y2n&~XiytG9!1ox;bw5Rbj~)7c(MFBb4>IiRATdhg zmiEFlj@S_hwYYI(ki{}&<;_7(Z0Qkfq>am z&LtL=2qc7rWguk3BtE4zL41@#S;NN*-jWw|7Kx7H7~_%7fPt;TIX}Ubo>;Rmj94V> zNB1=;-9AR7s`Pxn}t_6^3ahlq53e&!Lh85uG zec0vJY_6e`tg7LgfrJ3k!DjR)Bi#L@DHIrZ`sK=<5O0Ip!fxGf*OgGSpP@Hbbe&$9 z;ZI}8lEoC2_7;%L2=w?tb%1oL0V+=Z`7b=P&lNGY;yVBazXRYu;+cQDKvm*7NCxu&i;zub zAJh#11%?w>E2rf2e~C4+rAb-&$^vsdACs7 z@|Ra!OfVM(ke{vyiqh7puf&Yp6cd6{DptUteYfIRWG3pI+5< zBVBI_xkBAc<(pcb$!Y%dTW(b;B;2pOI-(QCsLv@U-D1XJ z(Gk8Q3l7Ws46Aktuj>|s{$6zA&xCPuXL-kB`CgYMs}4IeyG*P51IDwW?8UNQd+$i~ zlxOPtSi5L|gJcF@DwmJA5Ju8HEJ>o{{upwIpb!f{2(vLNBw`7xMbvcw<^{Fj@E~1( z?w`iIMieunS#>nXlmUcSMU+D3rX28f?s7z;X=se6bo8;5vM|O^(D6{A9*ChnGH!RG zP##3>LDC3jZPE4PH32AxrqPk|yIIrq~`aL-=}`okhNu9aT%q z1b)7iJ)CN=V#Ly84N_r7U^SH2FGdE5FpTO2 z630TF$P>GNMu8`rOytb(lB2};`;P4YNwW1<5d3Q~AX#P0aX}R2b2)`rgkp#zTxcGj zAV^cvFbhP|JgWrq_e`~exr~sIR$6p5V?o4Wym3kQ3HA+;Pr$bQ0(PmADVO%MKL!^q z?zAM8j1l4jrq|5X+V!8S*2Wl@=7*pPgciTVK6kS1Ge zMsd_u6DFK$jTnvVtE;qa+8(1sGBu~n&F%dh(&c(Zs4Fc#A=gG^^%^AyH}1^?|8quj zl@Z47h$){PlELJgYZCIHHL= z{U8O>Tw4x3<1{?$8>k-P<}1y9DmAZP_;(3Y*{Sk^H^A=_iSJ@+s5ktgwTXz_2$~W9>VVZsfwCm@s0sQ zeB50_yu@uS+e7QoPvdCwDz{prjo(AFwR%C?z`EL{1`|coJHQTk^nX=tvs1<0arUOJ z!^`*x&&BvTYmemyZ)2p~{%eYX=JVR?DYr(rNgqRMA5E1PR1Iw=prk=L2ldy3r3Vg@27IZx43+ywyzr-X*p*d@tZV+!U#~$-q=8c zgdSuh#r?b4GhEGNai)ayHQpk>5(%j5c@C1K3(W1pb~HeHpaqijJZa-e6vq_8t-^M^ zBJxq|MqZc?pjXPIH}70a5vt!IUh;l}<>VX<-Qcv^u@5(@@M2CHSe_hD$VG-eiV^V( zj7*9T0?di?P$FaD6oo?)<)QT>Npf6Og!GO^GmPV(Km0!=+dE&bk#SNI+C9RGQ|{~O*VC+tXK3!n`5 zHfl6>lwf_aEVV3`0T!aHNZLsj$paS$=LL(?b!Czaa5bbSuZ6#$_@LK<(7yrrl+80| z{tOFd=|ta2Z`^ssozD9BINn45NxUeCQis?-BKmU*Kt=FY-NJ+)8S1ecuFtN-M?&42 zl2$G>u!iNhAk*HoJ^4v^9#ORYp5t^wDj6|lx~5w45#E5wVqI1JQ~9l?nPp1YINf++ zMAdSif~_ETv@Er(EFBI^@L4BULFW>)NI+ejHFP*T}UhWNN`I)RRS8za? z*@`1>9ZB}An%aT5K=_2iQmfE;GcBVHLF!$`I99o5GO`O%O_zLr9AG18>&^HkG(;=V z%}c!OBQ~?MX(9h~tajX{=x)+!cbM7$YzTlmsPOdp2L-?GoW`@{lY9U3f;OUo*BwRB z8A+nv(br0-SH#VxGy#ZrgnGD(=@;HME;yd46EgWJ`EL%oXc&lFpc@Y}^>G(W>h_v_ zlN!`idhX+OjL+~T?19sroAFVGfa5tX-D49w$1g2g_-T|EpHL6}K_aX4$K=LTvwtlF zL*z}j{f+Uoe7{-px3_5iKPA<_7W=>Izkk)!l9ez2w%vi(?Y;i8AxRNLSOGDzNoqoI zP!1uAl}r=_871(G?y`i&)-7{u=%nxk7CZ_Qh#!|ITec zwQn`33GTUM`;D2POWnkqngqJhJRlM>CTONzTG}>^Q0wUunQyn|TAiHzyX2_%ATx%P z%7gW)%4rA9^)M<_%k@`Y?RbC<29sWU&5;@|9thf2#zf8z12$hRcZ!CSb>kUp=4N#y zl3hE#y6>kkA8VY2`W`g5Ip?2qC_BY$>R`iGQLhz2-S>x(RuWv)SPaGdl^)gGw7tjR zH@;jwk!jIaCgSg_*9iF|a);sRUTq30(8I(obh^|}S~}P4U^BIGYqcz;MPpC~Y@k_m zaw4WG1_vz2GdCAX!$_a%GHK**@IrHSkGoN>)e}>yzUTm52on`hYot7cB=oA-h1u|R ztH$11t?54Qg2L+i33FPFKKRm1aOjKST{l1*(nps`>sv%VqeVMWjl5+Gh+9);hIP8? zA@$?}Sc z3qIRpba+y5yf{R6G(u8Z^vkg0Fu&D-7?1s=QZU`Ub{-!Y`I?AGf1VNuc^L3v>)>i# z{DV9W$)>34wnzAXUiV^ZpYKw>UElrN_5Xj6{r_3| z$X5PK`e5$7>~9Dj7gK5ash(dvs`vwfk}&RD`>04;j62zoXESkFBklYaKm5seyiX(P zqQ-;XxlV*yg?Dhlx%xt!b0N3GHp@(p$A;8|%# zZ5m2KL|{on4nr>2_s9Yh=r5ScQ0;aMF)G$-9-Ca6%wA`Pa)i?NGFA|#Yi?{X-4ZO_ z^}%7%vkzvUHa$-^Y#aA+aiR5sa%S|Ebyn`EV<3Pc?ax_f>@sBZF1S;7y$CXd5t5=WGsTKBk8$OfH4v|0?0I=Yp}7c=WBSCg!{0n)XmiU;lfx)**zZaYqmDJelxk$)nZyx5`x$6R|fz(;u zEje5Dtm|a%zK!!tk3{i9$I2b{vXNFy%Bf{50X!x{98+BsDr_u9i>G5%*sqEX|06J0 z^IY{UcEbj6LDwuMh7cH`H@9sVt1l1#8kEQ(LyT@&+K}(ReE`ux8gb0r6L_#bDUo^P z3Ka2lRo52Hdtl_%+pwVs14=q`{d^L58PsU@AMf(hENumaxM{7iAT5sYmWh@hQCO^ zK&}ijo=`VqZ#a3vE?`7QW0ZREL17ZvDfdqKGD?0D4fg{7v%|Yj&_jcKJAB)>=*RS* zto8p6@k%;&^ZF>hvXm&$PCuEp{uqw3VPG$9VMdW5$w-fy2CNNT>E;>ejBgy-m_6`& z97L1p{%srn@O_JQgFpa_#f(_)eb#YS>o>q3(*uB;uZb605(iqM$=NK{nHY=+X2*G) zO3-_Xh%aG}fHWe*==58zBwp%&`mge<8uq8;xIxOd=P%9EK!34^E9sk|(Zq1QSz-JVeP12Fp)-`F|KY$LPwUE?rku zY@OJ)Z9A!ojfzfeyJ9;zv2EM7ZQB)AR5xGa-tMn^bl)FmoIiVyJ@!~@%{}qXXD&Ns zPnfe5U+&ohKefILu_1mPfLGuapX@btta5C#gPB2cjk5m4T}Nfi+Vfka!Yd(L?-c~5 z#ZK4VeQEXNPc4r$K00Fg>g#_W!YZ)cJ?JTS<&68_$#cZT-ME`}tcwqg3#``3M3UPvn+pi}(VNNx6y zFIMVb6OwYU(2`at$gHba*qrMVUl8xk5z-z~fb@Q3Y_+aXuEKH}L+>eW__!IAd@V}L zkw#s%H0v2k5-=vh$^vPCuAi22Luu3uKTf6fPo?*nvj$9(u)4$6tvF-%IM+3pt*cgs z_?wW}J7VAA{_~!?))?s6{M=KPpVhg4fNuU*|3THp@_(q!b*hdl{fjRVFWtu^1dV(f z6iOux9hi&+UK=|%M*~|aqFK{Urfl!TA}UWY#`w(0P!KMe1Si{8|o))Gy6d7;!JQYhgMYmXl?3FfOM2nQGN@~Ap6(G z3+d_5y@=nkpKAhRqf{qQ~k7Z$v&l&@m7Ppt#FSNzKPZM z8LhihcE6i=<(#87E|Wr~HKvVWhkll4iSK$^mUHaxgy8*K$_Zj;zJ`L$naPj+^3zTi z-3NTaaKnD5FPY-~?Tq6QHnmDDRxu0mh0D|zD~Y=vv_qig5r-cIbCpxlju&8Sya)@{ zsmv6XUSi)@(?PvItkiZEeN*)AE~I_?#+Ja-r8$(XiXei2d@Hi7Rx8+rZZb?ZLa{;@*EHeRQ-YDadz~M*YCM4&F-r;E#M+@CSJMJ0oU|PQ^ z=E!HBJDMQ2TN*Y(Ag(ynAL8%^v;=~q?s4plA_hig&5Z0x_^Oab!T)@6kRN$)qEJ6E zNuQjg|G7iwU(N8pI@_6==0CL;lRh1dQF#wePhmu@hADFd3B5KIH#dx(2A zp~K&;Xw}F_N6CU~0)QpQk7s$a+LcTOj1%=WXI(U=Dv!6 z{#<#-)2+gCyyv=Jw?Ab#PVkxPDeH|sAxyG`|Ys}A$PW4TdBv%zDz z^?lwrxWR<%Vzc8Sgt|?FL6ej_*e&rhqJZ3Y>k=X(^dytycR;XDU16}Pc9Vn0>_@H+ zQ;a`GSMEG64=JRAOg%~L)x*w{2re6DVprNp+FcNra4VdNjiaF0M^*>CdPkt(m150rCue?FVdL0nFL$V%5y6N z%eLr5%YN7D06k5ji5*p4v$UMM)G??Q%RB27IvH7vYr_^3>1D-M66#MN8tWGw>WED} z5AhlsanO=STFYFs)Il_0i)l)f<8qn|$DW7ZXhf5xI;m+7M5-%P63XFQrG9>DMqHc} zsgNU9nR`b}E^mL5=@7<1_R~j@q_2U^3h|+`7YH-?C=vme1C3m`Fe0HC>pjt6f_XMh zy~-i-8R46QNYneL4t@)<0VU7({aUO?aH`z4V2+kxgH5pYD5)wCh75JqQY)jIPN=U6 z+qi8cGiOtXG2tXm;_CfpH9ESCz#i5B(42}rBJJF$jh<1sbpj^8&L;gzGHb8M{of+} zzF^8VgML2O9nxBW7AvdEt90vp+#kZxWf@A)o9f9}vKJy9NDBjBW zSt=Hcs=YWCwnfY1UYx*+msp{g!w0HC<_SM!VL1(I2PE?CS}r(eh?{I)mQixmo5^p# zV?2R!R@3GV6hwTCrfHiK#3Orj>I!GS2kYhk1S;aFBD_}u2v;0HYFq}Iz1Z(I4oca4 zxquja8$+8JW_EagDHf$a1OTk5S97umGSDaj)gH=fLs9>_=XvVj^Xj9a#gLdk=&3tl zfmK9MNnIX9v{?%xdw7568 zNrZ|roYs(vC4pHB5RJ8>)^*OuyNC>x7ad)tB_}3SgQ96+-JT^Qi<`xi=)_=$Skwv~ zdqeT9Pa`LYvCAn&rMa2aCDV(TMI#PA5g#RtV|CWpgDYRA^|55LLN^uNh*gOU>Z=a06qJ;$C9z8;n-Pq=qZnc1zUwJ@t)L;&NN+E5m zRkQ(SeM8=l-aoAKGKD>!@?mWTW&~)uF2PYUJ;tB^my`r9n|Ly~0c%diYzqs9W#FTjy?h&X3TnH zXqA{QI82sdjPO->f=^K^f>N`+B`q9&rN0bOXO79S&a9XX8zund(kW7O76f4dcWhIu zER`XSMSFbSL>b;Rp#`CuGJ&p$s~G|76){d?xSA5wVg##_O0DrmyEYppyBr%fyWbbv zp`K84JwRNP$d-pJ!Qk|(RMr?*!wi1if-9G#0p>>1QXKXWFy)eB3ai)l3601q8!9JC zvU#ZWWDNKq9g6fYs?JQ)Q4C_cgTy3FhgKb8s&m)DdmL5zhNK#8wWg!J*7G7Qhe9VU zha?^AQTDpYcuN!B+#1dE*X{<#!M%zfUQbj=zLE{dW0XeQ7-oIsGY6RbkP2re@Q{}r_$iiH0xU%iN*ST`A)-EH6eaZB$GA#v)cLi z*MpA(3bYk$oBDKAzu^kJoSUsDd|856DApz={3u8sbQV@JnRkp2nC|)m;#T=DvIL-O zI4vh;g7824l}*`_p@MT4+d`JZ2%6NQh=N9bmgJ#q!hK@_<`HQq3}Z8Ij>3%~<*= zcv=!oT#5xmeGI92lqm9sGVE%#X$ls;St|F#u!?5Y7syhx6q#MVRa&lBmmn%$C0QzU z);*ldgwwCmzM3uglr}!Z2G+?& zf%Dpo&mD%2ZcNFiN-Z0f;c_Q;A%f@>26f?{d1kxIJD}LxsQkB47SAdwinfMILZdN3 zfj^HmTzS3Ku5BxY>ANutS8WPQ-G>v4^_Qndy==P3pDm+Xc?>rUHl-4+^%Sp5atOja z2oP}ftw-rqnb}+khR3CrRg^ibi6?QYk1*i^;kQGirQ=uB9Sd1NTfT-Rbv;hqnY4neE5H1YUrjS2m+2&@uXiAo- zrKUX|Ohg7(6F(AoP~tj;NZlV#xsfo-5reuQHB$&EIAhyZk;bL;k9ouDmJNBAun;H& zn;Of1z_Qj`x&M;5X;{s~iGzBQTY^kv-k{ksbE*Dl%Qf%N@hQCfY~iUw!=F-*$cpf2 z3wix|aLBV0b;W@z^%7S{>9Z^T^fLOI68_;l@+Qzaxo`nAI8emTV@rRhEKZ z?*z_{oGdI~R*#<2{bkz$G~^Qef}$*4OYTgtL$e9q!FY7EqxJ2`zk6SQc}M(k(_MaV zSLJnTXw&@djco1~a(vhBl^&w=$fa9{Sru>7g8SHahv$&Bl(D@(Zwxo_3r=;VH|uc5 zi1Ny)J!<(KN-EcQ(xlw%PNwK8U>4$9nVOhj(y0l9X^vP1TA>r_7WtSExIOsz`nDOP zs}d>Vxb2Vo2e5x8p(n~Y5ggAyvib>d)6?)|E@{FIz?G3PVGLf7-;BxaP;c?7ddH$z zA+{~k^V=bZuXafOv!RPsE1GrR3J2TH9uB=Z67gok+u`V#}BR86hB1xl}H4v`F+mRfr zYhortD%@IGfh!JB(NUNSDh+qDz?4ztEgCz&bIG-Wg7w-ua4ChgQR_c+z8dT3<1?uX z*G(DKy_LTl*Ea!%v!RhpCXW1WJO6F`bgS-SB;Xw9#! z<*K}=#wVu9$`Yo|e!z-CPYH!nj7s9dEPr-E`DXUBu0n!xX~&|%#G=BeM?X@shQQMf zMvr2!y7p_gD5-!Lnm|a@z8Of^EKboZsTMk%5VsJEm>VsJ4W7Kv{<|#4f-qDE$D-W>gWT%z-!qXnDHhOvLk=?^a1*|0j z{pW{M0{#1VcR5;F!!fIlLVNh_Gj zbnW(_j?0c2q$EHIi@fSMR{OUKBcLr{Y&$hrM8XhPByyZaXy|dd&{hYQRJ9@Fn%h3p7*VQolBIV@Eq`=y%5BU~3RPa^$a?ixp^cCg z+}Q*X+CW9~TL29@OOng(#OAOd!)e$d%sr}^KBJ-?-X&|4HTmtemxmp?cT3uA?md4% zT8yZ0U;6Rg6JHy3fJae{6TMGS?ZUX6+gGTT{Q{)SI85$5FD{g-eR%O0KMpWPY`4@O zx!hen1*8^E(*}{m^V_?}(b5k3hYo=T+$&M32+B`}81~KKZhY;2H{7O-M@vbCzuX0n zW-&HXeyr1%I3$@ns-V1~Lb@wIpkmx|8I~ob1Of7i6BTNysEwI}=!nU%q7(V_^+d*G z7G;07m(CRTJup!`cdYi93r^+LY+`M*>aMuHJm(A8_O8C#A*$!Xvddgpjx5)?_EB*q zgE8o5O>e~9IiSC@WtZpF{4Bj2J5eZ>uUzY%TgWF7wdDE!fSQIAWCP)V{;HsU3ap?4 znRsiiDbtN7i9hapO;(|Ew>Ip2TZSvK9Z^N21%J?OiA_&eP1{(Pu_=%JjKy|HOardq ze?zK^K zA%sjF64*Wufad%H<) z^|t>e*h+Z1#l=5wHexzt9HNDNXgM=-OPWKd^5p!~%SIl>Fo&7BvNpbf8{NXmH)o{r zO=aBJ;meX1^{O%q;kqdw*5k!Y7%t_30 zy{nGRVc&5qt?dBwLs+^Sfp;f`YVMSB#C>z^a9@fpZ!xb|b-JEz1LBX7ci)V@W+kvQ89KWA0T~Lj$aCcfW#nD5bt&Y_< z-q{4ZXDqVg?|0o)j1%l0^_it0WF*LCn-+)c!2y5yS7aZIN$>0LqNnkujV*YVes(v$ zY@_-!Q;!ZyJ}Bg|G-~w@or&u0RO?vlt5*9~yeoPV_UWrO2J54b4#{D(D>jF(R88u2 zo#B^@iF_%S>{iXSol8jpmsZuJ?+;epg>k=$d`?GSegAVp3n$`GVDvK${N*#L_1`44 z{w0fL{2%)0|E+qgZtjX}itZz^KJt4Y;*8uSK}Ft38+3>j|K(PxIXXR-t4VopXo#9# zt|F{LWr-?34y`$nLBVV_*UEgA6AUI65dYIbqpNq9cl&uLJ0~L}<=ESlOm?Y-S@L*d z<7vt}`)TW#f%Rp$Q}6@3=j$7Tze@_uZO@aMn<|si{?S}~maII`VTjs&?}jQ4_cut9$)PEqMukwoXobzaKx^MV z2fQwl+;LSZ$qy%Tys0oo^K=jOw$!YwCv^ei4NBVauL)tN%=wz9M{uf{IB(BxK|lT*pFkmNK_1tV`nb%jH=a0~VNq2RCKY(rG7jz!-D^k)Ec)yS%17pE#o6&eY+ z^qN(hQT$}5F(=4lgNQhlxj?nB4N6ntUY6(?+R#B?W3hY_a*)hnr4PA|vJ<6p`K3Z5Hy z{{8(|ux~NLUW=!?9Qe&WXMTAkQnLXg(g=I@(VG3{HE13OaUT|DljyWXPs2FE@?`iU z4GQlM&Q=T<4&v@Fe<+TuXiZQT3G~vZ&^POfmI1K2h6t4eD}Gk5XFGpbj1n_g*{qmD6Xy z`6Vv|lLZtLmrnv*{Q%xxtcWVj3K4M%$bdBk_a&ar{{GWyu#ljM;dII;*jP;QH z#+^o-A4np{@|Mz+LphTD0`FTyxYq#wY)*&Ls5o{0z9yg2K+K7ZN>j1>N&;r+Z`vI| zDzG1LJZ+sE?m?>x{5LJx^)g&pGEpY=fQ-4}{x=ru;}FL$inHemOg%|R*ZXPodU}Kh zFEd5#+8rGq$Y<_?k-}r5zgQ3jRV=ooHiF|@z_#D4pKVEmn5CGV(9VKCyG|sT9nc=U zEoT67R`C->KY8Wp-fEcjjFm^;Cg(ls|*ABVHq8clBE(;~K^b+S>6uj70g? z&{XQ5U&!Z$SO7zfP+y^8XBbiu*Cv-yJG|l-oe*!s5$@Lh_KpxYL2sx`B|V=dETN>5K+C+CU~a_3cI8{vbu$TNVdGf15*>D zz@f{zIlorkY>TRh7mKuAlN9A0>N>SV`X)+bEHms=mfYTMWt_AJtz_h+JMmrgH?mZt zm=lfdF`t^J*XLg7v+iS)XZROygK=CS@CvUaJo&w2W!Wb@aa?~Drtf`JV^cCMjngVZ zv&xaIBEo8EYWuML+vxCpjjY^s1-ahXJzAV6hTw%ZIy!FjI}aJ+{rE&u#>rs)vzuxz z+$5z=7W?zH2>Eb32dvgHYZtCAf!=OLY-pb4>Ae79rd68E2LkVPj-|jFeyqtBCCwiW zkB@kO_(3wFq)7qwV}bA=zD!*@UhT`geq}ITo%@O(Z5Y80nEX~;0-8kO{oB6|(4fQh z);73T!>3@{ZobPwRv*W?7m0Ml9GmJBCJd&6E?hdj9lV= z4flNfsc(J*DyPv?RCOx!MSvk(M952PJ-G|JeVxWVjN~SNS6n-_Ge3Q;TGE;EQvZg86%wZ`MB zSMQua(i*R8a75!6$QRO^(o7sGoomb+Y{OMy;m~Oa`;P9Yqo>?bJAhqXxLr7_3g_n>f#UVtxG!^F#1+y@os6x(sg z^28bsQ@8rw%Gxk-stAEPRbv^}5sLe=VMbkc@Jjimqjvmd!3E7+QnL>|(^3!R} zD-l1l7*Amu@j+PWLGHXXaFG0Ct2Q=}5YNUxEQHCAU7gA$sSC<5OGylNnQUa>>l%sM zyu}z6i&({U@x^hln**o6r2s-(C-L50tQvz|zHTqW!ir?w&V23tuYEDJVV#5pE|OJu z7^R!A$iM$YCe?8n67l*J-okwfZ+ZTkGvZ)tVPfR;|3gyFjF)8V zyXXN=!*bpyRg9#~Bg1+UDYCt0 ztp4&?t1X0q>uz;ann$OrZs{5*r`(oNvw=$7O#rD|Wuv*wIi)4b zGtq4%BX+kkagv3F9Id6~-c+1&?zny%w5j&nk9SQfo0k4LhdSU_kWGW7axkfpgR`8* z!?UTG*Zi_baA1^0eda8S|@&F z{)Rad0kiLjB|=}XFJhD(S3ssKlveFFmkN{Vl^_nb!o5M!RC=m)V&v2%e?ZoRC@h3> zJ(?pvToFd`*Zc@HFPL#=otWKwtuuQ_dT-Hr{S%pQX<6dqVJ8;f(o)4~VM_kEQkMR+ zs1SCVi~k>M`u1u2xc}>#D!V&6nOOh-E$O&SzYrjJdZpaDv1!R-QGA141WjQe2s0J~ zQ;AXG)F+K#K8_5HVqRoRM%^EduqOnS(j2)|ctA6Q^=|s_WJYU;Z%5bHp08HPL`YF2 zR)Ad1z{zh`=sDs^&V}J z%$Z$!jd7BY5AkT?j`eqMs%!Gm@T8)4w3GYEX~IwgE~`d|@T{WYHkudy(47brgHXx& zBL1yFG6!!!VOSmDxBpefy2{L_u5yTwja&HA!mYA#wg#bc-m%~8aRR|~AvMnind@zs zy>wkShe5&*un^zvSOdlVu%kHsEo>@puMQ`b1}(|)l~E{5)f7gC=E$fP(FC2=F<^|A zxeIm?{EE!3sO!Gr7e{w)Dx(uU#3WrFZ>ibmKSQ1tY?*-Nh1TDHLe+k*;{Rp!Bmd_m zb#^kh`Y*8l|9Cz2e{;RL%_lg{#^Ar+NH|3z*Zye>!alpt{z;4dFAw^^H!6ING*EFc z_yqhr8d!;%nHX9AKhFQZBGrSzfzYCi%C!(Q5*~hX>)0N`vbhZ@N|i;_972WSx*>LH z87?en(;2_`{_JHF`Sv6Wlps;dCcj+8IJ8ca6`DsOQCMb3n# z3)_w%FuJ3>fjeOOtWyq)ag|PmgQbC-s}KRHG~enBcIwqIiGW8R8jFeBNY9|YswRY5 zjGUxdGgUD26wOpwM#8a!Nuqg68*dG@VM~SbOroL_On0N6QdT9?)NeB3@0FCC?Z|E0 z6TPZj(AsPtwCw>*{eDEE}Gby>0q{*lI+g2e&(YQrsY&uGM{O~}(oM@YWmb*F zA0^rr5~UD^qmNljq$F#ARXRZ1igP`MQx4aS6*MS;Ot(1L5jF2NJ;de!NujUYg$dr# z=TEL_zTj2@>ZZN(NYCeVX2==~=aT)R30gETO{G&GM4XN<+!&W&(WcDP%oL8PyIVUC zs5AvMgh6qr-2?^unB@mXK*Dbil^y-GTC+>&N5HkzXtozVf93m~xOUHn8`HpX=$_v2 z61H;Z1qK9o;>->tb8y%#4H)765W4E>TQ1o0PFj)uTOPEvv&}%(_mG0ISmyhnQV33Z$#&yd{ zc{>8V8XK$3u8}04CmAQ#I@XvtmB*s4t8va?-IY4@CN>;)mLb_4!&P3XSw4pA_NzDb zORn!blT-aHk1%Jpi>T~oGLuh{DB)JIGZ9KOsciWs2N7mM1JWM+lna4vkDL?Q)z_Ct z`!mi0jtr+4*L&N7jk&LodVO#6?_qRGVaucqVB8*us6i3BTa^^EI0x%EREQSXV@f!lak6Wf1cNZ8>*artIJ(ADO*=<-an`3zB4d*oO*8D1K!f z*A@P1bZCNtU=p!742MrAj%&5v%Xp_dSX@4YCw%F|%Dk=u|1BOmo)HsVz)nD5USa zR~??e61sO(;PR)iaxK{M%QM_rIua9C^4ppVS$qCT9j2%?*em?`4Z;4@>I(c%M&#cH z>4}*;ej<4cKkbCAjjDsyKS8rIm90O)Jjgyxj5^venBx&7B!xLmzxW3jhj7sR(^3Fz z84EY|p1NauwXUr;FfZjdaAfh%ivyp+^!jBjJuAaKa!yCq=?T_)R!>16?{~p)FQ3LDoMyG%hL#pR!f@P%*;#90rs_y z@9}@r1BmM-SJ#DeuqCQk=J?ixDSwL*wh|G#us;dd{H}3*-Y7Tv5m=bQJMcH+_S`zVtf;!0kt*(zwJ zs+kedTm!A}cMiM!qv(c$o5K%}Yd0|nOd0iLjus&;s0Acvoi-PFrWm?+q9f^FslxGi z6ywB`QpL$rJzWDg(4)C4+!2cLE}UPCTBLa*_=c#*$b2PWrRN46$y~yST3a2$7hEH= zNjux+wna^AzQ=KEa_5#9Ph=G1{S0#hh1L3hQ`@HrVnCx{!fw_a0N5xV(iPdKZ-HOM za)LdgK}1ww*C_>V7hbQnTzjURJL`S%`6nTHcgS+dB6b_;PY1FsrdE8(2K6FN>37!62j_cBlui{jO^$dPkGHV>pXvW0EiOA zqW`YaSUBWg_v^Y5tPJfWLcLpsA8T zG)!x>pKMpt!lv3&KV!-um= zKCir6`bEL_LCFx4Z5bAFXW$g3Cq`?Q%)3q0r852XI*Der*JNuKUZ`C{cCuu8R8nkt z%pnF>R$uY8L+D!V{s^9>IC+bmt<05h**>49R*#vpM*4i0qRB2uPbg8{{s#9yC;Z18 zD7|4m<9qneQ84uX|J&f-g8a|nFKFt34@Bt{CU`v(SYbbn95Q67*)_Esl_;v291s=9 z+#2F2apZU4Tq=x+?V}CjwD(P=U~d<=mfEFuyPB`Ey82V9G#Sk8H_Ob_RnP3s?)S_3 zr%}Pb?;lt_)Nf>@zX~D~TBr;-LS<1I##8z`;0ZCvI_QbXNh8Iv)$LS=*gHr;}dgb=w5$3k2la1keIm|=7<-JD>)U%=Avl0Vj@+&vxn zt-)`vJxJr88D&!}2^{GPXc^nmRf#}nb$4MMkBA21GzB`-Or`-3lq^O^svO7Vs~FdM zv`NvzyG+0T!P8l_&8gH|pzE{N(gv_tgDU7SWeiI-iHC#0Ai%Ixn4&nt{5y3(GQs)i z&uA;~_0shP$0Wh0VooIeyC|lak__#KVJfxa7*mYmZ22@(<^W}FdKjd*U1CqSjNKW% z*z$5$=t^+;Ui=MoDW~A7;)Mj%ibX1_p4gu>RC}Z_pl`U*{_z@+HN?AF{_W z?M_X@o%w8fgFIJ$fIzBeK=v#*`mtY$HC3tqw7q^GCT!P$I%=2N4FY7j9nG8aIm$c9 zeKTxVKN!UJ{#W)zxW|Q^K!3s;(*7Gbn;e@pQBCDS(I|Y0euK#dSQ_W^)sv5pa%<^o zyu}3d?Lx`)3-n5Sy9r#`I{+t6x%I%G(iewGbvor&I^{lhu-!#}*Q3^itvY(^UWXgvthH52zLy&T+B)Pw;5>4D6>74 zO_EBS)>l!zLTVkX@NDqyN2cXTwsUVao7$HcqV2%t$YzdAC&T)dwzExa3*kt9d(}al zA~M}=%2NVNUjZiO7c>04YH)sRelXJYpWSn^aC$|Ji|E13a^-v2MB!Nc*b+=KY7MCm zqIteKfNkONq}uM;PB?vvgQvfKLPMB8u5+Am=d#>g+o&Ysb>dX9EC8q?D$pJH!MTAqa=DS5$cb+;hEvjwVfF{4;M{5U&^_+r zvZdu_rildI!*|*A$TzJ&apQWV@p{!W`=?t(o0{?9y&vM)V)ycGSlI3`;ps(vf2PUq zX745#`cmT*ra7XECC0gKkpu2eyhFEUb?;4@X7weEnLjXj_F~?OzL1U1L0|s6M+kIhmi%`n5vvDALMagi4`wMc=JV{XiO+^ z?s9i7;GgrRW{Mx)d7rj)?(;|b-`iBNPqdwtt%32se@?w4<^KU&585_kZ=`Wy^oLu9 z?DQAh5z%q;UkP48jgMFHTf#mj?#z|=w= z(q6~17Vn}P)J3M?O)x))%a5+>TFW3No~TgP;f}K$#icBh;rSS+R|}l鯊%1Et zwk~hMkhq;MOw^Q5`7oC{CUUyTw9x>^%*FHx^qJw(LB+E0WBX@{Ghw;)6aA-KyYg8p z7XDveQOpEr;B4je@2~usI5BlFadedX^ma{b{ypd|RNYqo#~d*mj&y`^iojR}s%~vF z(H!u`yx68D1Tj(3(m;Q+Ma}s2n#;O~bcB1`lYk%Irx60&-nWIUBr2x&@}@76+*zJ5 ze&4?q8?m%L9c6h=J$WBzbiTf1Z-0Eb5$IZs>lvm$>1n_Mezp*qw_pr8<8$6f)5f<@ zyV#tzMCs51nTv_5ca`x`yfE5YA^*%O_H?;tWYdM_kHPubA%vy47i=9>Bq) zRQ&0UwLQHeswmB1yP)+BiR;S+Vc-5TX84KUA;8VY9}yEj0eESSO`7HQ4lO z4(CyA8y1G7_C;6kd4U3K-aNOK!sHE}KL_-^EDl(vB42P$2Km7$WGqNy=%fqB+ zSLdrlcbEH=T@W8V4(TgoXZ*G1_aq$K^@ek=TVhoKRjw;HyI&coln|uRr5mMOy2GXP zwr*F^Y|!Sjr2YQXX(Fp^*`Wk905K%$bd03R4(igl0&7IIm*#f`A!DCarW9$h$z`kYk9MjjqN&5-DsH@8xh63!fTNPxWsFQhNv z#|3RjnP$Thdb#Ys7M+v|>AHm0BVTw)EH}>x@_f4zca&3tXJhTZ8pO}aN?(dHo)44Z z_5j+YP=jMlFqwvf3lq!57-SAuRV2_gJ*wsR_!Y4Z(trO}0wmB9%f#jNDHPdQGHFR; zZXzS-$`;7DQ5vF~oSgP3bNV$6Z(rwo6W(U07b1n3UHqml>{=6&-4PALATsH@Bh^W? z)ob%oAPaiw{?9HfMzpGb)@Kys^J$CN{uf*HX?)z=g`J(uK1YO^8~s1(ZIbG%Et(|q z$D@_QqltVZu9Py4R0Ld8!U|#`5~^M=b>fnHthzKBRr=i+w@0Vr^l|W;=zFT#PJ?*a zbC}G#It}rQP^Ait^W&aa6B;+0gNvz4cWUMzpv(1gvfw-X4xJ2Sv;mt;zb2Tsn|kSS zo*U9N?I{=-;a-OybL4r;PolCfiaL=y@o9{%`>+&FI#D^uy#>)R@b^1ue&AKKwuI*` zx%+6r48EIX6nF4o;>)zhV_8(IEX})NGU6Vs(yslrx{5fII}o3SMHW7wGtK9oIO4OM&@@ECtXSICLcPXoS|{;=_yj>hh*%hP27yZwOmj4&Lh z*Nd@OMkd!aKReoqNOkp5cW*lC)&C$P?+H3*%8)6HcpBg&IhGP^77XPZpc%WKYLX$T zsSQ$|ntaVVOoRat$6lvZO(G-QM5s#N4j*|N_;8cc2v_k4n6zx9c1L4JL*83F-C1Cn zaJhd;>rHXB%%ZN=3_o3&Qd2YOxrK~&?1=UuN9QhL$~OY-Qyg&})#ez*8NpQW_*a&kD&ANjedxT0Ar z<6r{eaVz3`d~+N~vkMaV8{F?RBVemN(jD@S8qO~L{rUw#=2a$V(7rLE+kGUZ<%pdr z?$DP|Vg#gZ9S}w((O2NbxzQ^zTot=89!0^~hE{|c9q1hVzv0?YC5s42Yx($;hAp*E zyoGuRyphQY{Q2ee0Xx`1&lv(l-SeC$NEyS~8iil3_aNlnqF_G|;zt#F%1;J)jnPT& z@iU0S;wHJ2$f!juqEzPZeZkjcQ+Pa@eERSLKsWf=`{R@yv7AuRh&ALRTAy z8=g&nxsSJCe!QLchJ=}6|LshnXIK)SNd zRkJNiqHwKK{SO;N5m5wdL&qK`v|d?5<4!(FAsDxR>Ky#0#t$8XCMptvNo?|SY?d8b z`*8dVBlXTUanlh6n)!EHf2&PDG8sXNAt6~u-_1EjPI1|<=33T8 zEnA00E!`4Ave0d&VVh0e>)Dc}=FfAFxpsC1u9ATfQ`-Cu;mhc8Z>2;uyXtqpLb7(P zd2F9<3cXS} znMg?{&8_YFTGRQZEPU-XPq55%51}RJpw@LO_|)CFAt62-_!u_Uq$csc+7|3+TV_!h z+2a7Yh^5AA{q^m|=KSJL+w-EWDBc&I_I1vOr^}P8i?cKMhGy$CP0XKrQzCheG$}G# zuglf8*PAFO8%xop7KSwI8||liTaQ9NCAFarr~psQt)g*pC@9bORZ>m`_GA`_K@~&% zijH0z;T$fd;-Liw8%EKZas>BH8nYTqsK7F;>>@YsE=Rqo?_8}UO-S#|6~CAW0Oz1} z3F(1=+#wrBJh4H)9jTQ_$~@#9|Bc1Pd3rAIA_&vOpvvbgDJOM(yNPhJJq2%PCcMaI zrbe~toYzvkZYQ{ea(Wiyu#4WB#RRN%bMe=SOk!CbJZv^m?Flo5p{W8|0i3`hI3Np# zvCZqY%o258CI=SGb+A3yJe~JH^i{uU`#U#fvSC~rWTq+K`E%J@ zasU07&pB6A4w3b?d?q}2=0rA#SA7D`X+zg@&zm^iA*HVi z009#PUH<%lk4z~p^l0S{lCJk1Uxi=F4e_DwlfHA`X`rv(|JqWKAA5nH+u4Da+E_p+ zVmH@lg^n4ixs~*@gm_dgQ&eDmE1mnw5wBz9Yg?QdZwF|an67Xd*x!He)Gc8&2!urh z4_uXzbYz-aX)X1>&iUjGp;P1u8&7TID0bTH-jCL&Xk8b&;;6p2op_=y^m@Nq*0{#o!!A;wNAFG@0%Z9rHo zcJs?Th>Ny6+hI`+1XoU*ED$Yf@9f91m9Y=#N(HJP^Y@ZEYR6I?oM{>&Wq4|v0IB(p zqX#Z<_3X(&{H+{3Tr|sFy}~=bv+l=P;|sBz$wk-n^R`G3p0(p>p=5ahpaD7>r|>pm zv;V`_IR@tvZreIuv2EM7ZQHhO+qUgw#kOs%*ekY^n|=1#x9&c;Ro&I~{rG-#_3ZB1 z?|9}IFdbP}^DneP*T-JaoYHt~r@EfvnPE5EKUwIxjPbsr$% zfWW83pgWST7*B(o=kmo)74$8UU)v0{@4DI+ci&%=#90}!CZz|rnH+Mz=HN~97G3~@ z;v5(9_2%eca(9iu@J@aqaMS6*$TMw!S>H(b z4(*B!|H|8&EuB%mITr~O?vVEf%(Gr)6E=>H~1VR z&1YOXluJSG1!?TnT)_*YmJ*o_Q@om~(GdrhI{$Fsx_zrkupc#y{DK1WOUR>tk>ZE) ziOLoBkhZZ?0Uf}cm>GsA>Rd6V8@JF)J*EQlQ<=JD@m<)hyElXR0`pTku*3MU`HJn| zIf7$)RlK^pW-$87U;431;Ye4Ie+l~_B3*bH1>*yKzn23cH0u(i5pXV! z4K?{3oF7ZavmmtTq((wtml)m6i)8X6ot_mrE-QJCW}Yn!(3~aUHYG=^fA<^~`e3yc z-NWTb{gR;DOUcK#zPbN^D*e=2eR^_!(!RKkiwMW@@yYtEoOp4XjOGgzi`;=8 zi3`Ccw1%L*y(FDj=C7Ro-V?q)-%p?Ob2ZElu`eZ99n14-ZkEV#y5C+{Pq87Gu3&>g zFy~Wk7^6v*)4pF3@F@rE__k3ikx(hzN3@e*^0=KNA6|jC^B5nf(XaoQaZN?Xi}Rn3 z$8&m*KmWvPaUQ(V<#J+S&zO|8P-#!f%7G+n_%sXp9=J%Z4&9OkWXeuZN}ssgQ#Tcj z8p6ErJQJWZ+fXLCco=RN8D{W%+*kko*2-LEb))xcHwNl~Xmir>kmAxW?eW50Osw3# zki8Fl$#fvw*7rqd?%E?}ZX4`c5-R&w!Y0#EBbelVXSng+kUfeUiqofPehl}$ormli zg%r)}?%=?_pHb9`Cq9Z|B`L8b>(!+8HSX?`5+5mm81AFXfnAt1*R3F z%b2RPIacKAddx%JfQ8l{3U|vK@W7KB$CdLqn@wP^?azRks@x8z59#$Q*7q!KilY-P zHUbs(IFYRGG1{~@RF;Lqyho$~7^hNC`NL3kn^Td%A7dRgr_&`2k=t+}D-o9&C!y^? z6MsQ=tc3g0xkK(O%DzR9nbNB(r@L;1zQrs8mzx&4dz}?3KNYozOW5;=w18U6$G4U2 z#2^qRLT*Mo4bV1Oeo1PKQ2WQS2Y-hv&S|C7`xh6=Pj7MNLC5K-zokZ67S)C;(F0Dd zloDK2_o1$Fmza>EMj3X9je7e%Q`$39Dk~GoOj89-6q9|_WJlSl!!+*{R=tGp z8u|MuSwm^t7K^nUe+^0G3dkGZr3@(X+TL5eah)K^Tn zXEtHmR9UIaEYgD5Nhh(s*fcG_lh-mfy5iUF3xxpRZ0q3nZ=1qAtUa?(LnT9I&~uxX z`pV?+=|-Gl(kz?w!zIieXT}o}7@`QO>;u$Z!QB${a08_bW0_o@&9cjJUXzVyNGCm8 zm=W+$H!;_Kzp6WQqxUI;JlPY&`V}9C$8HZ^m?NvI*JT@~BM=()T()Ii#+*$y@lTZBkmMMda>7s#O(1YZR+zTG@&}!EXFG{ zEWPSDI5bFi;NT>Yj*FjH((=oe%t%xYmE~AGaOc4#9K_XsVpl<4SP@E!TgC0qpe1oi zNpxU2b0(lEMcoibQ-G^cxO?ySVW26HoBNa;n0}CWL*{k)oBu1>F18X061$SP{Gu67 z-v-Fa=Fl^u3lnGY^o5v)Bux}bNZ~ z5pL+7F_Esoun8^5>z8NFoIdb$sNS&xT8_|`GTe8zSXQzs4r^g0kZjg(b0bJvz`g<70u9Z3fQILX1Lj@;@+##bP|FAOl)U^9U>0rx zGi)M1(Hce)LAvQO-pW!MN$;#ZMX?VE(22lTlJrk#pB0FJNqVwC+*%${Gt#r_tH9I_ z;+#)#8cWAl?d@R+O+}@1A^hAR1s3UcW{G+>;X4utD2d9X(jF555}!TVN-hByV6t+A zdFR^aE@GNNgSxxixS2p=on4(+*+f<8xrwAObC)D5)4!z7)}mTpb7&ofF3u&9&wPS< zB62WHLGMhmrmOAgmJ+|c>qEWTD#jd~lHNgT0?t-p{T=~#EMcB| z=AoDKOL+qXCfk~F)-Rv**V}}gWFl>liXOl7Uec_8v)(S#av99PX1sQIVZ9eNLkhq$ zt|qu0b?GW_uo}TbU8!jYn8iJeIP)r@;!Ze_7mj{AUV$GEz6bDSDO=D!&C9!M@*S2! zfGyA|EPlXGMjkH6x7OMF?gKL7{GvGfED=Jte^p=91FpCu)#{whAMw`vSLa`K#atdN zThnL+7!ZNmP{rc=Z>%$meH;Qi1=m1E3Lq2D_O1-X5C;!I0L>zur@tPAC9*7Jeh)`;eec}1`nkRP(%iv-`N zZ@ip-g|7l6Hz%j%gcAM}6-nrC8oA$BkOTz^?dakvX?`^=ZkYh%vUE z9+&)K1UTK=ahYiaNn&G5nHUY5niLGus@p5E2@RwZufRvF{@$hW{;{3QhjvEHMvduO z#Wf-@oYU4ht?#uP{N3utVzV49mEc9>*TV_W2TVC`6+oI)zAjy$KJrr=*q##&kobiQ z1vNbya&OVjK`2pdRrM?LuK6BgrLN7H_3m z!qpNKg~87XgCwb#I=Q&0rI*l$wM!qTkXrx1ko5q-f;=R2fImRMwt5Qs{P*p^z@9ex z`2#v(qE&F%MXlHpdO#QEZyZftn4f05ab^f2vjxuFaat2}jke{j?5GrF=WYBR?gS(^ z9SBiNi}anzBDBRc+QqizTTQuJrzm^bNA~A{j%ugXP7McZqJ}65l10({wk++$=e8O{ zxWjG!Qp#5OmI#XRQQM?n6?1ztl6^D40hDJr?4$Wc&O_{*OfMfxe)V0=e{|N?J#fgE>j9jAajze$iN!*yeF%jJU#G1c@@rm zolGW!j?W6Q8pP=lkctNFdfgUMg92wlM4E$aks1??M$~WQfzzzXtS)wKrr2sJeCN4X zY(X^H_c^PzfcO8Bq(Q*p4c_v@F$Y8cHLrH$`pJ2}=#*8%JYdqsqnGqEdBQMpl!Ot04tUGSXTQdsX&GDtjbWD=prcCT9(+ z&UM%lW%Q3yrl1yiYs;LxzIy>2G}EPY6|sBhL&X&RAQrSAV4Tlh2nITR?{6xO9ujGu zr*)^E`>o!c=gT*_@6S&>0POxcXYNQd&HMw6<|#{eSute2C3{&h?Ah|cw56-AP^f8l zT^kvZY$YiH8j)sk7_=;gx)vx-PW`hbSBXJGCTkpt;ap(}G2GY=2bbjABU5)ty%G#x zAi07{Bjhv}>OD#5zh#$0w;-vvC@^}F! z#X$@)zIs1L^E;2xDAwEjaXhTBw2<{&JkF*`;c3<1U@A4MaLPe{M5DGGkL}#{cHL%* zYMG+-Fm0#qzPL#V)TvQVI|?_M>=zVJr9>(6ib*#z8q@mYKXDP`k&A4A};xMK0h=yrMp~JW{L?mE~ph&1Y1a#4%SO)@{ zK2juwynUOC)U*hVlJU17%llUxAJFuKZh3K0gU`aP)pc~bE~mM!i1mi!~LTf>1Wp< zuG+ahp^gH8g8-M$u{HUWh0m^9Rg@cQ{&DAO{PTMudV6c?ka7+AO& z746QylZ&Oj`1aqfu?l&zGtJnpEQOt;OAFq19MXTcI~`ZcoZmyMrIKDFRIDi`FH)w; z8+*8tdevMDv*VtQi|e}CnB_JWs>fhLOH-+Os2Lh!&)Oh2utl{*AwR)QVLS49iTp{6 z;|172Jl!Ml17unF+pd+Ff@jIE-{Oxv)5|pOm@CkHW?{l}b@1>Pe!l}VccX#xp@xgJ zyE<&ep$=*vT=}7vtvif0B?9xw_3Gej7mN*dOHdQPtW5kA5_zGD zpA4tV2*0E^OUimSsV#?Tg#oiQ>%4D@1F5@AHwT8Kgen$bSMHD3sXCkq8^(uo7CWk`mT zuslYq`6Yz;L%wJh$3l1%SZv#QnG3=NZ=BK4yzk#HAPbqXa92;3K5?0kn4TQ`%E%X} z&>Lbt!!QclYKd6+J7Nl@xv!uD%)*bY-;p`y^ZCC<%LEHUi$l5biu!sT3TGGSTPA21 zT8@B&a0lJHVn1I$I3I1I{W9fJAYc+8 zVj8>HvD}&O`TqU2AAb={?eT;0hyL(R{|h23=4fDSZKC32;wWxsVj`P z3J3{M$PwdH!ro*Cn!D&=jnFR>BNGR<<|I8CI@+@658Dy(lhqbhXfPTVecY@L8%`3Q z1Fux2w?2C3th60jI~%OC9BtpNF$QPqcG+Pz96qZJ71_`0o0w_q7|h&O>`6U+^BA&5 zXd5Zp1Xkw~>M%RixTm&OqpNl8Q+ue=92Op_>T~_9UON?ZM2c0aGm=^A4ejrXj3dV9 zhh_bCt-b9`uOX#cFLj!vhZ#lS8Tc47OH>*)y#{O9?AT~KR9LntM|#l#Dlm^8{nZdk zjMl#>ZM%#^nK2TPzLcKxqx24P7R1FPlBy7LSBrRvx>fE$9AJ;7{PQm~^LBX^k#6Zq zw*Z(zJC|`!6_)EFR}8|n8&&Rbj8y028~P~sFXBFRt+tmqH-S3<%N;C&WGH!f3{7cm zy_fCAb9@HqaXa1Y5vFbxWf%#zg6SI$C+Uz5=CTO}e|2fjWkZ;Dx|84Ow~bkI=LW+U zuq;KSv9VMboRvs9)}2PAO|b(JCEC_A0wq{uEj|3x@}*=bOd zwr{TgeCGG>HT<@Zeq8y}vTpwDg#UBvD)BEs@1KP$^3$sh&_joQPn{hjBXmLPJ{tC) z*HS`*2+VtJO{|e$mM^|qv1R*8i(m1`%)}g=SU#T#0KlTM2RSvYUc1fP+va|4;5}Bfz98UvDCpq7}+SMV&;nX zQw~N6qOX{P55{#LQkrZk(e5YGzr|(B;Q;ju;2a`q+S9bsEH@i1{_Y0;hWYn1-79jl z5c&bytD*k)GqrVcHn6t-7kinadiD>B{Tl`ZY@`g|b~pvHh5!gKP4({rp?D0aFd_cN zhHRo4dd5^S6ViN(>(28qZT6E>??aRhc($kP`>@<+lIKS5HdhjVU;>f7<4))E*5|g{ z&d1}D|vpuV^eRj5j|xx9nwaCxXFG?Qbjn~_WSy=N}P0W>MP zG-F%70lX5Xr$a)2i6?i|iMyM|;Jtf*hO?=Jxj12oz&>P=1#h~lf%#fc73M2_(SUM- zf&qnjS80|_Y0lDgl&I?*eMumUklLe_=Td!9G@eR*tcPOgIShJipp3{A10u(4eT~DY zHezEj8V+7m!knn7)W!-5QI3=IvC^as5+TW1@Ern@yX| z7Nn~xVx&fGSr+L%4iohtS3w^{-H1A_5=r&x8}R!YZvp<2T^YFvj8G_vm}5q;^UOJf ztl=X3iL;;^^a#`t{Ae-%5Oq{?M#s6Npj+L(n-*LMI-yMR{)qki!~{5z{&`-iL}lgW zxo+tnvICK=lImjV$Z|O_cYj_PlEYCzu-XBz&XC-JVxUh9;6*z4fuBG+H{voCC;`~GYV|hj%j_&I zDZCj>Q_0RCwFauYoVMiUSB+*Mx`tg)bWmM^SwMA+?lBg12QUF_x2b)b?qb88K-YUd z0dO}3k#QirBV<5%jL$#wlf!60dizu;tsp(7XLdI=eQs?P`tOZYMjVq&jE)qK*6B^$ zBe>VvH5TO>s>izhwJJ$<`a8fakTL!yM^Zfr2hV9`f}}VVUXK39p@G|xYRz{fTI+Yq z20d=)iwjuG9RB$%$^&8#(c0_j0t_C~^|n+c`Apu|x7~;#cS-s=X1|C*YxX3ailhg_|0`g!E&GZJEr?bh#Tpb8siR=JxWKc{#w7g zWznLwi;zLFmM1g8V5-P#RsM@iX>TK$xsWuujcsVR^7TQ@!+vCD<>Bk9tdCo7Mzgq5 zv8d>dK9x8C@Qoh01u@3h0X_`SZluTb@5o;{4{{eF!-4405x8X7hewZWpz z2qEi4UTiXTvsa(0X7kQH{3VMF>W|6;6iTrrYD2fMggFA&-CBEfSqPlQDxqsa>{e2M z(R5PJ7uOooFc|9GU0ELA%m4&4Ja#cQpNw8i8ACAoK6?-px+oBl_yKmenZut#Xumjz zk8p^OV2KY&?5MUwGrBOo?ki`Sxo#?-Q4gw*Sh0k`@ zFTaYK2;}%Zk-68`#5DXU$2#=%YL#S&MTN8bF+!J2VT6x^XBci6O)Q#JfW{YMz) zOBM>t2rSj)n#0a3cjvu}r|k3od6W(SN}V-cL?bi*Iz-8uOcCcsX0L>ZXjLqk zZu2uHq5B|Kt>e+=pPKu=1P@1r9WLgYFq_TNV1p9pu0erHGd!+bBp!qGi+~4A(RsYN@CyXNrC&hxGmW)u5m35OmWwX`I+0yByglO`}HC4nGE^_HUs^&A(uaM zKPj^=qI{&ayOq#z=p&pnx@@k&I1JI>cttJcu@Ihljt?6p^6{|ds`0MoQwp+I{3l6` zB<9S((RpLG^>=Kic`1LnhpW2=Gu!x`m~=y;A`Qk!-w`IN;S8S930#vBVMv2vCKi}u z6<-VPrU0AnE&vzwV(CFC0gnZYcpa-l5T0ZS$P6(?9AM;`Aj~XDvt;Jua=jIgF=Fm? zdp=M$>`phx%+Gu};;-&7T|B1AcC#L4@mW5SV_^1BRbo6;2PWe$r+npRV`yc;T1mo& z+~_?7rA+(Um&o@Tddl zL_hxvWk~a)yY}%j`Y+200D%9$bWHy&;(yj{jpi?Rtz{J66ANw)UyPOm;t6FzY3$hx zcn)Ir79nhFvNa7^a{SHN7XH*|Vlsx`CddPnA&Qvh8aNhEA;mPVv;Ah=k<*u!Zq^7 z<=xs*iQTQOMMcg|(NA_auh@x`3#_LFt=)}%SQppP{E>mu_LgquAWvh<>L7tf9+~rO znwUDS52u)OtY<~!d$;m9+87aO+&`#2ICl@Y>&F{jI=H(K+@3M1$rr=*H^dye#~TyD z!){#Pyfn+|ugUu}G;a~!&&0aqQ59U@UT3|_JuBlYUpT$2+11;}JBJ`{+lQN9T@QFY z5+`t;6(TS0F?OlBTE!@7D`8#URDNqx2t6`GZ{ZgXeS@v%-eJzZOHz18aS|svxII$a zZeFjrJ*$IwX$f-Rzr_G>xbu@euGl)B7pC&S+CmDJBg$BoV~jxSO#>y z33`bupN#LDoW0feZe0%q8un0rYN|eRAnwDHQ6e_)xBTbtoZtTA=Fvk){q}9Os~6mQ zKB80VI_&6iSq`LnK7*kfHZoeX6?WE}8yjuDn=2#JG$+;-TOA1%^=DnXx%w{b=w}tS zQbU3XxtOI8E(!%`64r2`zog;5<0b4i)xBmGP^jiDZ2%HNSxIf3@wKs~uk4%3Mxz;~ zts_S~E4>W+YwI<-*-$U8*^HKDEa8oLbmqGg?3vewnaNg%Mm)W=)lcC_J+1ov^u*N3 zXJ?!BrH-+wGYziJq2Y#vyry6Z>NPgkEk+Ke`^DvNRdb>Q2Nlr#v%O@<5hbflI6EKE z9dWc0-ORk^T}jP!nkJ1imyjdVX@GrjOs%cpgA8-c&FH&$(4od#x6Y&=LiJZPINVyW z0snY$8JW@>tc2}DlrD3StQmA0Twck~@>8dSix9CyQOALcREdxoM$Sw*l!}bXKq9&r zysMWR@%OY24@e`?+#xV2bk{T^C_xSo8v2ZI=lBI*l{RciPwuE>L5@uhz@{!l)rtVlWC>)6(G)1~n=Q|S!{E9~6*fdpa*n z!()-8EpTdj=zr_Lswi;#{TxbtH$8*G=UM`I+icz7sr_SdnHXrv=?iEOF1UL+*6O;% zPw>t^kbW9X@oEXx<97%lBm-9?O_7L!DeD)Me#rwE54t~UBu9VZ zl_I1tBB~>jm@bw0Aljz8! zXBB6ATG6iByKIxs!qr%pz%wgqbg(l{65DP4#v(vqhhL{0b#0C8mq`bnqZ1OwFV z7mlZZJFMACm>h9v^2J9+^_zc1=JjL#qM5ZHaThH&n zXPTsR8(+)cj&>Un{6v*z?@VTLr{TmZ@-fY%*o2G}*G}#!bmqpoo*Ay@U!JI^Q@7gj;Kg-HIrLj4}#ec4~D2~X6vo;ghep-@&yOivYP zC19L0D`jjKy1Yi-SGPAn94(768Tcf$urAf{)1)9W58P`6MA{YG%O?|07!g9(b`8PXG1B1Sh0?HQmeJtP0M$O$hI z{5G`&9XzYhh|y@qsF1GnHN|~^ru~HVf#)lOTSrv=S@DyR$UKQk zjdEPFDz{uHM&UM;=mG!xKvp;xAGHOBo~>_=WFTmh$chpC7c`~7?36h)7$fF~Ii}8q zF|YXxH-Z?d+Q+27Rs3X9S&K3N+)OBxMHn1u(vlrUC6ckBY@@jl+mgr#KQUKo#VeFm zFwNYgv0<%~Wn}KeLeD9e1$S>jhOq&(e*I@L<=I5b(?G(zpqI*WBqf|Zge0&aoDUsC zngMRA_Kt0>La+Erl=Uv_J^p(z=!?XHpenzn$%EA`JIq#yYF?JLDMYiPfM(&Csr#f{ zdd+LJL1by?xz|D8+(fgzRs~(N1k9DSyK@LJygwaYX8dZl0W!I&c^K?7)z{2is;OkE zd$VK-(uH#AUaZrp=1z;O*n=b?QJkxu`Xsw&7yrX0?(CX=I-C#T;yi8a<{E~?vr3W> zQrpPqOW2M+AnZ&p{hqmHZU-;Q(7?- zP8L|Q0RM~sB0w1w53f&Kd*y}ofx@c z5Y6B8qGel+uT1JMot$nT1!Tim6{>oZzJXdyA+4euOLME?5Fd_85Uk%#E*ln%y{u8Q z$|?|R@Hpb~yTVK-Yr_S#%NUy7EBfYGAg>b({J|5b+j-PBpPy$Ns`PaJin4JdRfOaS zE|<HjH%NuJgsd2wOlv>~y=np%=2)$M9LS|>P)zJ+Fei5vYo_N~B0XCn+GM76 z)Xz3tg*FRVFgIl9zpESgdpWAavvVViGlU8|UFY{{gVJskg*I!ZjWyk~OW-Td4(mZ6 zB&SQreAAMqwp}rjy`HsG({l2&q5Y52<@AULVAu~rWI$UbFuZs>Sc*x+XI<+ez%$U)|a^unjpiW0l0 zj1!K0(b6$8LOjzRqQ~K&dfbMIE=TF}XFAi)$+h}5SD3lo z%%Qd>p9se=VtQG{kQ;N`sI)G^u|DN#7{aoEd zkksYP%_X$Rq08);-s6o>CGJ<}v`qs%eYf+J%DQ^2k68C%nvikRsN?$ap--f+vCS`K z#&~)f7!N^;sdUXu54gl3L=LN>FB^tuK=y2e#|hWiWUls__n@L|>xH{%8lIJTd5`w? zSwZbnS;W~DawT4OwSJVdAylbY+u5S+ZH{4hAi2&}Iv~W(UvHg(1GTZRPz`@{SOqzy z(8g&Dz=$PfRV=6FgxN~zo+G8OoPI&d-thcGVR*_^(R8COTM@bq?fDwY{}WhsQS1AK zF6R1t8!RdFmfocpJ6?9Yv~;WYi~XPgs(|>{5})j!AR!voO7y9&cMPo#80A(`za@t>cx<0;qxM@S*m(jYP)dMXr*?q0E`oL;12}VAep179uEr8c<=D zr5?A*C{eJ`z9Ee;E$8)MECqatHkbHH z&Y+ho0B$31MIB-xm&;xyaFCtg<{m~M-QDbY)fQ>Q*Xibb~8ytxZQ?QMf9!%cV zU0_X1@b4d+Pg#R!`OJ~DOrQz3@cpiGy~XSKjZQQ|^4J1puvwKeScrH8o{bscBsowomu z^f12kTvje`yEI3eEXDHJ6L+O{Jv$HVj%IKb|J{IvD*l6IG8WUgDJ*UGz z3!C%>?=dlfSJ>4U88)V+`U-!9r^@AxJBx8R;)J4Fn@`~k>8>v0M9xp90OJElWP&R5 zM#v*vtT}*Gm1^)Bv!s72T3PB0yVIjJW)H7a)ilkAvoaH?)jjb`MP>2z{%Y?}83 zUIwBKn`-MSg)=?R)1Q0z3b>dHE^)D8LFs}6ASG1|daDly_^lOSy&zIIhm*HXm1?VS=_iacG);_I9c zUQH1>i#*?oPIwBMJkzi_*>HoUe}_4o>2(SHWzqQ=;TyhAHS;Enr7!#8;sdlty&(>d zl%5cjri8`2X^Ds`jnw7>A`X|bl=U8n+3LKLy(1dAu8`g@9=5iw$R0qk)w8Vh_Dt^U zIglK}sn^)W7aB(Q>HvrX=rxB z+*L)3DiqpQ_%~|m=44LcD4-bxO3OO*LPjsh%p(k?&jvLp0py57oMH|*IMa(<|{m1(0S|x)?R-mqJ=I;_YUZA>J z62v*eSK;5w!h8J+6Z2~oyGdZ68waWfy09?4fU&m7%u~zi?YPHPgK6LDwphgaYu%0j zurtw)AYOpYKgHBrkX189mlJ`q)w-f|6>IER{5Lk97%P~a-JyCRFjejW@L>n4vt6#hq;!|m;hNE||LK3nw1{bJOy+eBJjK=QqNjI;Q6;Rp5 z&035pZDUZ#%Oa;&_7x0T<7!RW`#YBOj}F380Bq?MjjEhrvlCATPdkCTTl+2efTX$k zH&0zR1n^`C3ef~^sXzJK-)52(T}uTG%OF8yDhT76L~|^+hZ2hiSM*QA9*D5odI1>& z9kV9jC~twA5MwyOx(lsGD_ggYmztXPD`2=_V|ks_FOx!_J8!zM zTzh^cc+=VNZ&(OdN=y4Juw)@8-85lwf_#VMN!Ed(eQiRiLB2^2e`4dp286h@v@`O%_b)Y~A; zv}r6U?zs&@uD_+(_4bwoy7*uozNvp?bXFoB8?l8yG0qsm1JYzIvB_OH4_2G*IIOwT zVl%HX1562vLVcxM_RG*~w_`FbIc!(T=3>r528#%mwwMK}uEhJ()3MEby zQQjzqjWkwfI~;Fuj(Lj=Ug0y`>~C7`w&wzjK(rPw+Hpd~EvQ-ufQOiB4OMpyUKJhw zqEt~jle9d7S~LI~$6Z->J~QJ{Vdn3!c}g9}*KG^Kzr^(7VI5Gk(mHLL{itj_hG?&K4Ws0+T4gLfi3eu$N=`s36geNC?c zm!~}vG6lx9Uf^5M;bWntF<-{p^bruy~f?sk9 zcETAPQZLoJ8JzMMg<-=ju4keY@SY%Wo?u9Gx=j&dfa6LIAB|IrbORLV1-H==Z1zCM zeZcOYpm5>U2fU7V*h;%n`8 zN95QhfD994={1*<2vKLCNF)feKOGk`R#K~G=;rfq}|)s20&MCa65 zUM?xF5!&e0lF%|U!#rD@I{~OsS_?=;s_MQ_b_s=PuWdC)q|UQ&ea)DMRh5>fpQjXe z%9#*x=7{iRCtBKT#H>#v%>77|{4_slZ)XCY{s3j_r{tdpvb#|r|sbS^dU1x70$eJMU!h{Y7Kd{dl}9&vxQl6Jt1a` zHQZrWyY0?!vqf@u-fxU_@+}u(%Wm>0I#KP48tiAPYY!TdW(o|KtVI|EUB9V`CBBNaBLVih7+yMVF|GSoIQD0Jfb{ z!OXq;(>Z?O`1gap(L~bUcp>Lc@Jl-})^=6P%<~~9ywY=$iu8pJ0m*hOPzr~q`23eX zgbs;VOxxENe0UMVeN*>uCn9Gk!4siN-e>x)pIKAbQz!G)TcqIJ0`JBBaX>1-4_XO_-HCS^vr2vjv#7KltDZdyQ{tlWh4$Gm zB>|O1cBDC)yG(sbnc*@w6e%e}r*|IhpXckx&;sQCwGdKH+3oSG-2)Bf#x`@<4ETAr z0My%7RFh6ZLiZ_;X6Mu1YmXx7C$lSZ^}1h;j`EZd6@%JNUe=btBE z%s=Xmo1Ps?8G`}9+6>iaB8bgjUdXT?=trMu|4yLX^m0Dg{m7rpKNJey|EwHI+nN1e zL^>qN%5Fg)dGs4DO~uwIdXImN)QJ*Jhpj7$fq_^`{3fwpztL@WBB}OwQ#Epo-mqMO zsM$UgpFiG&d#)lzEQ{3Q;)&zTw;SzGOah-Dpm{!q7<8*)Ti_;xvV2TYXa}=faXZy? z3y?~GY@kl)>G&EvEijk9y1S`*=zBJSB1iet>0;x1Ai)*`^{pj0JMs)KAM=@UyOGtO z3y0BouW$N&TnwU6!%zS%nIrnANvZF&vB1~P5_d`x-giHuG zPJ;>XkVoghm#kZXRf>qxxEix;2;D1CC~NrbO6NBX!`&_$iXwP~P*c($EVV|669kDO zKoTLZNF4Cskh!Jz5ga9uZ`3o%7Pv`d^;a=cXI|>y;zC3rYPFLQkF*nv(r>SQvD*## z(Vo%^9g`%XwS0t#94zPq;mYGLKu4LU3;txF26?V~A0xZbU4Lmy`)>SoQX^m7fd^*E z+%{R4eN!rIk~K)M&UEzxp9dbY;_I^c} zOc{wlIrN_P(PPqi51k_$>Lt|X6A^|CGYgKAmoI#Li?;Wq%q~q*L7ehZkUrMxW67Jl zhsb~+U?33QS>eqyN{(odAkbopo=Q$Az?L+NZW>j;#~@wCDX?=L5SI|OxI~7!Pli;e zELMFcZtJY3!|=Gr2L4>z8yQ-{To>(f80*#;6`4IAiqUw`=Pg$%C?#1 z_g@hIGerILSU>=P>z{gM|DS91A4cT@PEIB^hSop!uhMo#2G;+tQSpDO_6nOnPWSLU zS;a9m^DFMXR4?*X=}d7l;nXuHk&0|m`NQn%d?8|Ab3A9l9Jh5s120ibWBdB z$5YwsK3;wvp!Kn@)Qae{ef`0#NwlRpQ}k^r>yos_Ne1;xyKLO?4)t_G4eK~wkUS2A&@_;)K0-03XGBzU+5f+uMDxC z(s8!8!RvdC#@`~fx$r)TKdLD6fWEVdEYtV#{ncT-ZMX~eI#UeQ-+H(Z43vVn%Yj9X zLdu9>o%wnWdvzA-#d6Z~vzj-}V3FQ5;axDIZ;i(95IIU=GQ4WuU{tl-{gk!5{l4_d zvvb&uE{%!iFwpymz{wh?bKr1*qzeZb5f6e6m_ozRF&zux2mlK=v_(_s^R6b5lu?_W4W3#<$zeG~Pd)^!4tzhs}-Sx$FJP>)ZGF(hVTH|C3(U zs0PO&*h_ zNA-&qZpTP$$LtIgfiCn07}XDbK#HIXdmv8zdz4TY;ifNIH-0jy(gMSByG2EF~Th#eb_TueZC` zE?3I>UTMpKQ})=C;6p!?G)M6w^u*A57bD?2X`m3X^6;&4%i_m(uGJ3Z5h`nwxM<)H z$I5m?wN>O~8`BGnZ=y^p6;0+%_0K}Dcg|K;+fEi|qoBqvHj(M&aHGqNF48~XqhtU? z^ogwBzRlOfpAJ+Rw7IED8lRbTdBdyEK$gPUpUG}j-M42xDj_&qEAQEtbs>D#dRd7Y z<&TpSZ(quQDHiCFn&0xsrz~4`4tz!CdL8m~HxZM_agu@IrBpyeL1Ft}V$HX_ZqDPm z-f89)pjuEzGdq-PRu`b1m+qBGY{zr_>{6Ss>F|xHZlJj9dt5HD$u`1*WZe)qEIuDSR)%z+|n zatVlhQ?$w#XRS7xUrFE;Y8vMGhQS5*T{ZnY=q1P?w5g$OKJ#M&e??tAmPWHMj3xhS ziGxapy?kn@$~2%ZY;M8Bc@%$pkl%Rvj!?o%agBvpQ-Q61n9kznC4ttrRNQ4%GFR5u zyv%Yo9~yxQJWJSfj z?#HY$y=O~F|2pZs22pu|_&Ajd+D(Mt!nPUG{|1nlvP`=R#kKH zO*s$r_%ss5h1YO7k0bHJ2CXN)Yd6CHn~W!R=SqkWe=&nAZu(Q1G!xgcUilM@YVei@2@a`8he z9@pM`)VB*=e7-MWgLlXlc)t;fF&-AwM{E-EX}pViFn0I0CNw2bNEnN2dj!^4(^zS3 zobUm1uQnpqk_4q{pl*n06=TfK_C>UgurKFjRXsK_LEn};=79`TB12tv6KzwSu*-C8 z;=~ohDLZylHQ|Mpx-?yql>|e=vI1Z!epyUpAcDCp4T|*RV&X`Q$0ogNwy6mFALo^@ z9=&(9txO8V@E!@6^(W0{*~CT>+-MA~vnJULBxCTUW>X5>r7*eXYUT0B6+w@lzw%n> z_VjJ<2qf|(d6jYq2(x$(ZDf!yVkfnbvNmb5c|hhZ^2TV_LBz`9w!e_V*W_(MiA7|= z&EeIIkw*+$Xd!)j8<@_<}A5;~A_>3JT*kX^@}cDoLd>Qj<`Se^wdUa(j0dp+Tl8EptwBm{9OGsdFEq zM`!pjf(Lm(`$e3FLOjqA5LnN5o!}z{ zNf}rJuZh@yUtq&ErjHeGzX4(!luV!jB&;FAP|!R_QHYw#^Z1LwTePAKJ6X&IDNO#; z)#I@Xnnzyij~C@UH~X51JCgQeF0&hTXnuoElz#m{heZRexWc0k4<>0+ClX7%0 zEBqCCld1tD9Zwkr4{?Nor19#E5-YKfB8d?qgR82-Ow2^AuNevly2*tHA|sK!ybYkX zm-sLQH72P&{vEAW6+z~O5d0qd=xW~rua~5a?ymYFSD@8&gV)E5@RNNBAj^C99+Z5Z zR@Pq55mbCQbz+Mn$d_CMW<-+?TU960agEk1J<>d>0K=pF19yN))a~4>m^G&tc*xR+yMD*S=yip-q=H zIlredHpsJV8H(32@Zxc@bX6a21dUV95Th--8pE6C&3F>pk=yv$yd6@Haw;$v4+Fcb zRwn{Qo@0`7aPa2LQOP}j9v>sjOo5Kqvn|`FLizX zB+@-u4Lw|jsvz{p^>n8Vo8H2peIqJJnMN}A)q6%$Tmig7eu^}K2 zrh$X?T|ZMsoh{6pdw1G$_T<`Ds-G=jc;qcGdK4{?dN2-XxjDNbb(7pk|3JUVCU4y; z)?LXR>f+AAu)JEiti_Zy#z5{RgsC}R(@jl%9YZ>zu~hKQ*AxbvhC378-I@{~#%Y`Z zy=a=9YpewPIC+gkEUUwtUL7|RU7=!^Aa}Mk^6uxOgRGA#JXjWLsjFUnix|Mau{hDT z7mn*z1m5g`vP(#tjT0Zy4eAY(br&!RiiXE=ZI!{sE1#^#%x^Z7t1U)b<;%Y}Q9=5v z;wpDCEZ@OE36TWT=|gxigT@VaW9BvHS05;_P(#s z8zI4XFQys}q)<`tkX$WnSarn{3e!s}4(J!=Yf>+Y>cP3f;vr63f2{|S^`_pWc)^5_!R z*(x-fuBxL51@xe!lnDBKi}Br$c$BMZ3%f2Sa6kLabiBS{pq*yj;q|k(86x`PiC{p6 z_bxCW{>Q2BA8~Ggz&0jkrcU+-$ANBsOop*ms>34K9lNYil@}jC;?cYP(m^P}nR6FV zk(M%48Z&%2Rx$A&FhOEirEhY0(dn;-k(qkTU)sFQ`+-ih+s@A8g?r8Pw+}2;35WYf zi}VO`jS`p(tc)$X$a>-#WXoW!phhatC*$}|rk>|wUU71eUJG^$c6_jwX?iSHM@6__ zvV|6%U*$sSXJu9SX?2%M^kK|}a2QJ8AhF{fuXrHZxXsI~O zGKX45!K7p*MCPEQ=gp?eu&#AW*pR{lhQR##P_*{c_DjMGL|3T3-bSJ(o$|M{ytU}> zAV>wq*uE*qFo9KvnA^@juy{x<-u*#2NvkV={Ly}ysKYB-k`K3@K#^S1Bb$8Y#0L0# z`6IkSG&|Z$ODy|VLS+y5pFJx&8tvPmMd8c9FhCyiU8~k6FwkakUd^(_ml8`rnl>JS zZV){9G*)xBqPz^LDqRwyS6w86#D^~xP4($150M)SOZRe9sn=>V#aG0Iy(_^YcPpIz8QYM-#s+n% z@Jd?xQq?Xk6=<3xSY7XYP$$yd&Spu{A#uafiIfy8gRC`o0nk{ezEDjb=q_qRAlR1d zFq^*9Gn)yTG4b}R{!+3hWQ+u3GT~8nwl2S1lpw`s0X_qpxv)g+JIkVKl${sYf_nV~B>Em>M;RlqGb5WVil(89 zs=ld@|#;dq1*vQGz=7--Br-|l) zZ%Xh@v8>B7P?~}?Cg$q9_={59l%m~O&*a6TKsCMAzG&vD>k2WDzJ6!tc!V)+oxF;h zJH;apM=wO?r_+*#;ulohuP=E>^zon}a$NnlcQ{1$SO*i=jnGVcQa^>QOILc)e6;eNTI>os=eaJ{*^DE+~jc zS}TYeOykDmJ=6O%>m`i*>&pO_S;qMySJIyP=}4E&J%#1zju$RpVAkZbEl+p%?ZP^C z*$$2b4t%a(e+%>a>d_f_<JjxI#J1x;=hPd1zFPx=6T$;;X1TD*2(edZ3f46zaAoW>L53vS_J*N8TMB|n+;LD| zC=GkQPpyDY#Am4l49chDv*gojhRj_?63&&8#doW`INATAo(qY#{q}%nf@eTIXmtU< zdB<7YWfyCmBs|c)cK>1)v&M#!yNj#4d$~pVfDWQc_ke1?fw{T1Nce_b`v|Vp5ig(H zJvRD^+ps46^hLX;=e2!2e;w9y1D@!D$c@Jc&%%%IL=+xzw55&2?darw=9g~>P z9>?Kdc$r?6c$m%x2S$sdpPl>GQZ{rC9mPS63*qjCVa?OIBj!fW zm|g?>CVfGXNjOfcyqImXR_(tXS(F{FcoNzKvG5R$IgGaxC@)i(e+$ME}vPVIhd|mx2IIE+f zM?9opQHIVgBWu)^A|RzXw!^??S!x)SZOwZaJkGjc<_}2l^eSBm!eAJG9T>EC6I_sy z?bxzDIAn&K5*mX)$RQzDA?s)-no-XF(g*yl4%+GBf`##bDXJ==AQk*xmnatI;SsLp zP9XTHq5mmS=iWu~9ES>b%Q=1aMa|ya^vj$@qz9S!ih{T8_PD%Sf_QrNKwgrXw9ldm zHRVR98*{C?_XNpJn{abA!oix_mowRMu^2lV-LPi;0+?-F(>^5#OHX-fPED zCu^l7u3E%STI}c4{J2!)9SUlGP_@!d?5W^QJXOI-Ea`hFMKjR7TluLvzC-ozCPn1`Tpy z!vlv@_Z58ILX6>nDjTp-1LlFMx~-%GA`aJvG$?8*Ihn;mH37eK**rmOEwqegf-Ccx zrIX4;{c~RK>XuTXxYo5kMiWMy)!IC{*DHG@E$hx?RwP@+wuad(P1{@%tRkyJRqD)3 zMHHHZ4boqDn>-=DgR5VlhQTpfVy182Gk;A_S8A1-;U1RR>+$62>(MUx@Nox$vTjHq z%QR=j!6Gdyb5wu7y(YUktwMuW5<@jl?m4cv4BODiT5o8qVdC0MBqGr@-YBIwnpZAY znX9(_uQjP}JJ=!~Ve9#5I~rUnN|P_3D$LqZcvBnywYhjlMSFHm`;u9GPla{5QD7(7*6Tb3Svr8;(nuAd81q$*uq6HC_&~je*Ca7hP4sJp0av{M8480wF zxASi7Qv+~@2U%Nu1Ud;s-G4CTVWIPyx!sg&8ZG0Wq zG_}i3C(6_1>q3w!EH7$Kwq8uBp2F2N7}l65mk1p*9v0&+;th=_E-W)E;w}P(j⁢ zv5o9#E7!G0XmdzfsS{efPNi`1b44~SZ4Z8fuX!I}#8g+(wxzQwUT#Xb2(tbY1+EUhGKoT@KEU9Ktl>_0 z%bjDJg;#*gtJZv!-Zs`?^}v5eKmnbjqlvnSzE@_SP|LG_PJ6CYU+6zY6>92%E+ z=j@TZf-iW4(%U{lnYxQA;7Q!b;^brF8n0D>)`q5>|WDDXLrqYU_tKN2>=#@~OE7grMnNh?UOz-O~6 z6%rHy{#h9K0AT+lDC7q4{hw^|q6*Ry;;L%Q@)Ga}$60_q%D)rv(CtS$CQbpq9|y1e zRSrN4;$Jyl{m5bZw`$8TGvb}(LpY{-cQ)fcyJv7l3S52TLXVDsphtv&aPuDk1OzCA z4A^QtC(!11`IsNx_HnSy?>EKpHJWT^wmS~hc^p^zIIh@9f6U@I2 zC=Mve{j2^)mS#U$e{@Q?SO6%LDsXz@SY+=cK_QMmXBIU)j!$ajc-zLx3V60EXJ!qC zi<%2x8Q24YN+&8U@CIlN zrZkcT9yh%LrlGS9`G)KdP(@9Eo-AQz@8GEFWcb7U=a0H^ZVbLmz{+&M7W(nXJ4sN8 zJLR7eeK(K8`2-}j(T7JsO`L!+CvbueT%izanm-^A1Dn{`1Nw`9P?cq;7no+XfC`K(GO9?O^5zNIt4M+M8LM0=7Gz8UA@Z0N+lg+cX)NfazRu z5D)~HA^(u%w^cz+@2@_#S|u>GpB+j4KzQ^&Wcl9f z&hG#bCA(Yk0D&t&aJE^xME^&E-&xGHhXn%}psEIj641H+Nl-}boj;)Zt*t(4wZ5DN z@GXF$bL=&pBq-#vkTkh>7hl%K5|3 z{`Vn9b$iR-SoGENp}bn4;fR3>9sA%X2@1L3aE9yTra;Wb#_`xWwLSLdfu+PAu+o3| zGVnpzPr=ch{uuoHjtw7+_!L_2;knQ!DuDl0R`|%jr+}jFzXtrHIKc323?JO{l&;VF z*L1+}JU7%QJOg|5|Tc|D8fN zJORAg=_vsy{ak|o);@)Yh8Lkcg@$FG3k@ep36BRa^>~UmnRPziS>Z=`Jb2x*Q#`%A zU*i3&Vg?TluO@X0O;r2Jl6LKLUOVhSqg1*qOt^|8*c7 zo(298@+r$k_wQNGHv{|$tW(T8L+4_`FQ{kEW5Jgg{yf7ey4ss_(SNKfz(N9lx&a;< je(UuV8hP?p&}TPdm1I$XmG#(RzlD&B2izSj9sl%y5~4qc diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3fa8f86..a441313 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..b740cf1 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index 6689b85..7101f8e 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/src/main/java/com/seam/api/Seam.java b/src/main/java/com/seam/api/Seam.java index 4344f6f..261ba6c 100644 --- a/src/main/java/com/seam/api/Seam.java +++ b/src/main/java/com/seam/api/Seam.java @@ -6,16 +6,19 @@ import com.seam.api.core.ClientOptions; import com.seam.api.core.Suppliers; import com.seam.api.resources.accesscodes.AccessCodesClient; +import com.seam.api.resources.acs.AcsClient; import com.seam.api.resources.actionattempts.ActionAttemptsClient; import com.seam.api.resources.clientsessions.ClientSessionsClient; import com.seam.api.resources.connectedaccounts.ConnectedAccountsClient; import com.seam.api.resources.connectwebviews.ConnectWebviewsClient; import com.seam.api.resources.devices.DevicesClient; import com.seam.api.resources.events.EventsClient; -import com.seam.api.resources.health.HealthClient; import com.seam.api.resources.locks.LocksClient; +import com.seam.api.resources.networks.NetworksClient; import com.seam.api.resources.noisesensors.NoiseSensorsClient; +import com.seam.api.resources.phones.PhonesClient; import com.seam.api.resources.thermostats.ThermostatsClient; +import com.seam.api.resources.useridentities.UserIdentitiesClient; import com.seam.api.resources.webhooks.WebhooksClient; import com.seam.api.resources.workspaces.WorkspacesClient; import java.util.function.Supplier; @@ -29,41 +32,50 @@ public class Seam { protected final Supplier clientSessionsClient; - protected final Supplier connectedAccountsClient; - protected final Supplier connectWebviewsClient; + protected final Supplier connectedAccountsClient; + protected final Supplier devicesClient; protected final Supplier eventsClient; - protected final Supplier healthClient; - protected final Supplier locksClient; - protected final Supplier noiseSensorsClient; + protected final Supplier networksClient; + + protected final Supplier phonesClient; protected final Supplier thermostatsClient; + protected final Supplier userIdentitiesClient; + protected final Supplier webhooksClient; protected final Supplier workspacesClient; + protected final Supplier acsClient; + + protected final Supplier noiseSensorsClient; + public Seam(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.accessCodesClient = Suppliers.memoize(() -> new AccessCodesClient(clientOptions)); this.actionAttemptsClient = Suppliers.memoize(() -> new ActionAttemptsClient(clientOptions)); this.clientSessionsClient = Suppliers.memoize(() -> new ClientSessionsClient(clientOptions)); - this.connectedAccountsClient = Suppliers.memoize(() -> new ConnectedAccountsClient(clientOptions)); this.connectWebviewsClient = Suppliers.memoize(() -> new ConnectWebviewsClient(clientOptions)); + this.connectedAccountsClient = Suppliers.memoize(() -> new ConnectedAccountsClient(clientOptions)); this.devicesClient = Suppliers.memoize(() -> new DevicesClient(clientOptions)); this.eventsClient = Suppliers.memoize(() -> new EventsClient(clientOptions)); - this.healthClient = Suppliers.memoize(() -> new HealthClient(clientOptions)); this.locksClient = Suppliers.memoize(() -> new LocksClient(clientOptions)); - this.noiseSensorsClient = Suppliers.memoize(() -> new NoiseSensorsClient(clientOptions)); + this.networksClient = Suppliers.memoize(() -> new NetworksClient(clientOptions)); + this.phonesClient = Suppliers.memoize(() -> new PhonesClient(clientOptions)); this.thermostatsClient = Suppliers.memoize(() -> new ThermostatsClient(clientOptions)); + this.userIdentitiesClient = Suppliers.memoize(() -> new UserIdentitiesClient(clientOptions)); this.webhooksClient = Suppliers.memoize(() -> new WebhooksClient(clientOptions)); this.workspacesClient = Suppliers.memoize(() -> new WorkspacesClient(clientOptions)); + this.acsClient = Suppliers.memoize(() -> new AcsClient(clientOptions)); + this.noiseSensorsClient = Suppliers.memoize(() -> new NoiseSensorsClient(clientOptions)); } public AccessCodesClient accessCodes() { @@ -78,14 +90,14 @@ public ClientSessionsClient clientSessions() { return this.clientSessionsClient.get(); } - public ConnectedAccountsClient connectedAccounts() { - return this.connectedAccountsClient.get(); - } - public ConnectWebviewsClient connectWebviews() { return this.connectWebviewsClient.get(); } + public ConnectedAccountsClient connectedAccounts() { + return this.connectedAccountsClient.get(); + } + public DevicesClient devices() { return this.devicesClient.get(); } @@ -94,22 +106,26 @@ public EventsClient events() { return this.eventsClient.get(); } - public HealthClient health() { - return this.healthClient.get(); - } - public LocksClient locks() { return this.locksClient.get(); } - public NoiseSensorsClient noiseSensors() { - return this.noiseSensorsClient.get(); + public NetworksClient networks() { + return this.networksClient.get(); + } + + public PhonesClient phones() { + return this.phonesClient.get(); } public ThermostatsClient thermostats() { return this.thermostatsClient.get(); } + public UserIdentitiesClient userIdentities() { + return this.userIdentitiesClient.get(); + } + public WebhooksClient webhooks() { return this.webhooksClient.get(); } @@ -118,6 +134,14 @@ public WorkspacesClient workspaces() { return this.workspacesClient.get(); } + public AcsClient acs() { + return this.acsClient.get(); + } + + public NoiseSensorsClient noiseSensors() { + return this.noiseSensorsClient.get(); + } + public static SeamBuilder builder() { return new SeamBuilder(); } diff --git a/src/main/java/com/seam/api/SeamBuilder.java b/src/main/java/com/seam/api/SeamBuilder.java index 45da23d..9f6790b 100644 --- a/src/main/java/com/seam/api/SeamBuilder.java +++ b/src/main/java/com/seam/api/SeamBuilder.java @@ -9,15 +9,45 @@ public final class SeamBuilder { private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); + private String apiKey = null; + + private String seamWorkspace = null; + + private String seamClientSessionToken = null; + + private String clientSessionToken = null; + private Environment environment = Environment.DEFAULT; + /** + * Sets apiKey + */ public SeamBuilder apiKey(String apiKey) { - this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + apiKey); + this.apiKey = apiKey; return this; } + /** + * Sets seamWorkspace + */ public SeamBuilder seamWorkspace(String seamWorkspace) { - this.clientOptionsBuilder.addHeader("Seam-Workspace", seamWorkspace); + this.seamWorkspace = seamWorkspace; + return this; + } + + /** + * Sets seamClientSessionToken + */ + public SeamBuilder seamClientSessionToken(String seamClientSessionToken) { + this.seamClientSessionToken = seamClientSessionToken; + return this; + } + + /** + * Sets clientSessionToken + */ + public SeamBuilder clientSessionToken(String clientSessionToken) { + this.clientSessionToken = clientSessionToken; return this; } @@ -32,6 +62,19 @@ public SeamBuilder url(String url) { } public Seam build() { + this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.apiKey); + if (seamWorkspace == null) { + throw new RuntimeException("Please provide seamWorkspace"); + } + this.clientOptionsBuilder.addHeader("seam-workspace", this.seamWorkspace); + if (seamClientSessionToken == null) { + throw new RuntimeException("Please provide seamClientSessionToken"); + } + this.clientOptionsBuilder.addHeader("seam-client-session-token", this.seamClientSessionToken); + if (clientSessionToken == null) { + throw new RuntimeException("Please provide clientSessionToken"); + } + this.clientOptionsBuilder.addHeader("client-session-token", this.clientSessionToken); clientOptionsBuilder.environment(this.environment); return new Seam(clientOptionsBuilder.build()); } diff --git a/src/main/java/com/seam/api/core/ApiError.java b/src/main/java/com/seam/api/core/ApiError.java deleted file mode 100644 index f8daf8b..0000000 --- a/src/main/java/com/seam/api/core/ApiError.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.core; - -public final class ApiError extends RuntimeException { - private final int statusCode; - - private final Object body; - - public ApiError(int statusCode, Object body) { - this.statusCode = statusCode; - this.body = body; - } - - public int statusCode() { - return this.statusCode; - } - - public Object body() { - return this.body; - } - - @Override - public String toString() { - return "ApiError{" + "statusCode: " + statusCode + ", body: " + body + "}"; - } -} diff --git a/src/main/java/com/seam/api/core/ClientOptions.java b/src/main/java/com/seam/api/core/ClientOptions.java index 5ad21aa..ffbd1f7 100644 --- a/src/main/java/com/seam/api/core/ClientOptions.java +++ b/src/main/java/com/seam/api/core/ClientOptions.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import okhttp3.OkHttpClient; @@ -25,11 +26,15 @@ private ClientOptions( this.environment = environment; this.headers = new HashMap<>(); this.headers.putAll(headers); - this.headers.putAll(Map.of( - "X-Fern-SDK-Name", "com.seam.fern:api-sdk", "X-Fern-SDK-Version", "0.2.1", "X-Fern-Language", "JAVA")); + this.headers.putAll(new HashMap() { + { + put("X-Fern-Language", "JAVA"); + put("X-Fern-SDK-Name", "com.seam.fern:api-sdk"); + put("X-Fern-SDK-Version", "0.3.0"); + } + }); this.headerSuppliers = headerSuppliers; this.httpClient = httpClient; - ; } public Environment environment() { @@ -51,6 +56,19 @@ public OkHttpClient httpClient() { return this.httpClient; } + public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { + if (requestOptions == null) { + return this.httpClient; + } + return this.httpClient + .newBuilder() + .callTimeout(requestOptions.getTimeout().get(), requestOptions.getTimeoutTimeUnit()) + .connectTimeout(0, TimeUnit.SECONDS) + .writeTimeout(0, TimeUnit.SECONDS) + .readTimeout(0, TimeUnit.SECONDS) + .build(); + } + public static Builder builder() { return new Builder(); } diff --git a/src/main/java/com/seam/api/core/MediaTypes.java b/src/main/java/com/seam/api/core/MediaTypes.java new file mode 100644 index 0000000..2f0dc1a --- /dev/null +++ b/src/main/java/com/seam/api/core/MediaTypes.java @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.core; + +import okhttp3.MediaType; + +public final class MediaTypes { + + public static final MediaType APPLICATION_JSON = MediaType.parse("application/json"); + + private MediaTypes() {} +} diff --git a/src/main/java/com/seam/api/core/RequestOptions.java b/src/main/java/com/seam/api/core/RequestOptions.java index 5c85d59..caacc4a 100644 --- a/src/main/java/com/seam/api/core/RequestOptions.java +++ b/src/main/java/com/seam/api/core/RequestOptions.java @@ -5,15 +5,43 @@ import java.util.HashMap; import java.util.Map; +import java.util.Optional; +import java.util.concurrent.TimeUnit; public final class RequestOptions { private final String apiKey; private final String seamWorkspace; - private RequestOptions(String apiKey, String seamWorkspace) { + private final String seamClientSessionToken; + + private final String clientSessionToken; + + private final Optional timeout; + + private final TimeUnit timeoutTimeUnit; + + private RequestOptions( + String apiKey, + String seamWorkspace, + String seamClientSessionToken, + String clientSessionToken, + Optional timeout, + TimeUnit timeoutTimeUnit) { this.apiKey = apiKey; this.seamWorkspace = seamWorkspace; + this.seamClientSessionToken = seamClientSessionToken; + this.clientSessionToken = clientSessionToken; + this.timeout = timeout; + this.timeoutTimeUnit = timeoutTimeUnit; + } + + public Optional getTimeout() { + return timeout; + } + + public TimeUnit getTimeoutTimeUnit() { + return timeoutTimeUnit; } public Map getHeaders() { @@ -22,7 +50,13 @@ public Map getHeaders() { headers.put("Authorization", "Bearer " + this.apiKey); } if (this.seamWorkspace != null) { - headers.put("Seam-Workspace", this.seamWorkspace); + headers.put("seam-workspace", this.seamWorkspace); + } + if (this.seamClientSessionToken != null) { + headers.put("seam-client-session-token", this.seamClientSessionToken); + } + if (this.clientSessionToken != null) { + headers.put("client-session-token", this.clientSessionToken); } return headers; } @@ -36,6 +70,14 @@ public static final class Builder { private String seamWorkspace = null; + private String seamClientSessionToken = null; + + private String clientSessionToken = null; + + private Optional timeout = null; + + private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS; + public Builder apiKey(String apiKey) { this.apiKey = apiKey; return this; @@ -46,8 +88,30 @@ public Builder seamWorkspace(String seamWorkspace) { return this; } + public Builder seamClientSessionToken(String seamClientSessionToken) { + this.seamClientSessionToken = seamClientSessionToken; + return this; + } + + public Builder clientSessionToken(String clientSessionToken) { + this.clientSessionToken = clientSessionToken; + return this; + } + + public Builder timeout(Integer timeout) { + this.timeout = Optional.of(timeout); + return this; + } + + public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) { + this.timeout = Optional.of(timeout); + this.timeoutTimeUnit = timeoutTimeUnit; + return this; + } + public RequestOptions build() { - return new RequestOptions(apiKey, seamWorkspace); + return new RequestOptions( + apiKey, seamWorkspace, seamClientSessionToken, clientSessionToken, timeout, timeoutTimeUnit); } } } diff --git a/src/main/java/com/seam/api/core/RetryInterceptor.java b/src/main/java/com/seam/api/core/RetryInterceptor.java index 31826eb..77f842b 100644 --- a/src/main/java/com/seam/api/core/RetryInterceptor.java +++ b/src/main/java/com/seam/api/core/RetryInterceptor.java @@ -25,22 +25,22 @@ public Response intercept(Chain chain) throws IOException { Response response = chain.proceed(chain.request()); if (shouldRetry(response.code())) { - return retryChain(chain); + return retryChain(response, chain); } return response; } - private Response retryChain(Chain chain) throws IOException { + private Response retryChain(Response response, Chain chain) throws IOException { Optional nextBackoff = this.backoff.nextBackoff(); - while (nextBackoff.isPresent()) { try { Thread.sleep(nextBackoff.get().toMillis()); } catch (InterruptedException e) { throw new IOException("Interrupted while trying request", e); } - Response response = chain.proceed(chain.request()); + response.close(); + response = chain.proceed(chain.request()); if (shouldRetry(response.code())) { nextBackoff = this.backoff.nextBackoff(); } else { @@ -48,7 +48,7 @@ private Response retryChain(Chain chain) throws IOException { } } - throw new IOException("Max retries reached"); + return response; } private static boolean shouldRetry(int statusCode) { diff --git a/src/main/java/com/seam/api/core/SeamApiApiError.java b/src/main/java/com/seam/api/core/SeamApiApiError.java new file mode 100644 index 0000000..22e8dc2 --- /dev/null +++ b/src/main/java/com/seam/api/core/SeamApiApiError.java @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.core; + +/** + * This exception type will be thrown for any non-2XX API responses. + */ +public class SeamApiApiError extends SeamApiError { + /** + * The error code of the response that triggered the exception. + */ + private final int statusCode; + + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public SeamApiApiError(String message, int statusCode, Object body) { + super(message); + this.statusCode = statusCode; + this.body = body; + } + + /** + * @return the statusCode + */ + public int statusCode() { + return this.statusCode; + } + + /** + * @return the body + */ + public Object body() { + return this.body; + } + + @java.lang.Override + public String toString() { + return "SeamApiApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + + "}"; + } +} diff --git a/src/main/java/com/seam/api/core/SeamApiError.java b/src/main/java/com/seam/api/core/SeamApiError.java new file mode 100644 index 0000000..d6b019a --- /dev/null +++ b/src/main/java/com/seam/api/core/SeamApiError.java @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.core; + +/** + * This class serves as the base exception for all errors in the SDK. + */ +public class SeamApiError extends RuntimeException { + public SeamApiError(String message) { + super(message); + } + + public SeamApiError(String message, Exception e) { + super(message, e); + } +} diff --git a/src/main/java/com/seam/api/core/Stream.java b/src/main/java/com/seam/api/core/Stream.java new file mode 100644 index 0000000..0eb42f4 --- /dev/null +++ b/src/main/java/com/seam/api/core/Stream.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.core; + +import java.io.Reader; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Scanner; + +/** + * The {@code Stream} class implmenets {@link Iterable} to provide a simple mechanism for reading and parsing + * objects of a given type from data streamed via a {@link Reader} using a specified delimiter. + *

+ * {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a + * {@code Scanner} to block during iteration if the next object is not available. + * + * @param The type of objects in the stream. + */ +public final class Stream implements Iterable { + /** + * The {@link Class} of the objects in the stream. + */ + private final Class valueType; + /** + * The {@link Scanner} used for reading from the input stream and blocking when neede during iteration. + */ + private final Scanner scanner; + + /** + * Constructs a new {@code Stream} with the specified value type, reader, and delimiter. + * + * @param valueType The class of the objects in the stream. + * @param reader The reader that provides the streamed data. + * @param delimiter The delimiter used to separate elements in the stream. + */ + public Stream(Class valueType, Reader reader, String delimiter) { + this.scanner = new Scanner(reader).useDelimiter(delimiter); + this.valueType = valueType; + } + + /** + * Returns an iterator over the elements in this stream that blocks during iteration when the next object is + * not yet available. + * + * @return An iterator that can be used to traverse the elements in the stream. + */ + @Override + public Iterator iterator() { + return new Iterator() { + /** + * Returns {@code true} if there are more elements in the stream. + *

+ * Will block and wait for input if the stream has not ended and the next object is not yet available. + * + * @return {@code true} if there are more elements, {@code false} otherwise. + */ + @Override + public boolean hasNext() { + return scanner.hasNext(); + } + + /** + * Returns the next element in the stream. + *

+ * Will block and wait for input if the stream has not ended and the next object is not yet available. + * + * @return The next element in the stream. + * @throws NoSuchElementException If there are no more elements in the stream. + */ + @Override + public T next() { + if (!scanner.hasNext()) { + throw new NoSuchElementException(); + } else { + try { + T parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + scanner.next().trim(), valueType); + return parsedResponse; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + /** + * Removing elements from {@code Stream} is not supported. + * + * @throws UnsupportedOperationException Always, as removal is not supported. + */ + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } +} diff --git a/src/main/java/com/seam/api/errors/SeamApiBadRequestError.java b/src/main/java/com/seam/api/errors/SeamApiBadRequestError.java new file mode 100644 index 0000000..41f74ba --- /dev/null +++ b/src/main/java/com/seam/api/errors/SeamApiBadRequestError.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.errors; + +import com.seam.api.core.SeamApiApiError; + +public final class SeamApiBadRequestError extends SeamApiApiError { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public SeamApiBadRequestError(Object body) { + super("BadRequestError", 400, body); + this.body = body; + } + + /** + * @return the body + */ + @Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/seam/api/errors/SeamApiUnauthorizedError.java b/src/main/java/com/seam/api/errors/SeamApiUnauthorizedError.java new file mode 100644 index 0000000..5c96498 --- /dev/null +++ b/src/main/java/com/seam/api/errors/SeamApiUnauthorizedError.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.errors; + +import com.seam.api.core.SeamApiApiError; + +public final class SeamApiUnauthorizedError extends SeamApiApiError { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public SeamApiUnauthorizedError(Object body) { + super("UnauthorizedError", 401, body); + this.body = body; + } + + /** + * @return the body + */ + @Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/seam/api/resources/accesscodes/AccessCodesClient.java b/src/main/java/com/seam/api/resources/accesscodes/AccessCodesClient.java index 5686233..82e1d64 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/AccessCodesClient.java +++ b/src/main/java/com/seam/api/resources/accesscodes/AccessCodesClient.java @@ -3,38 +3,45 @@ */ package com.seam.api.resources.accesscodes; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; import com.seam.api.core.Suppliers; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.accesscodes.requests.AccessCodesCreateMultipleRequest; import com.seam.api.resources.accesscodes.requests.AccessCodesCreateRequest; import com.seam.api.resources.accesscodes.requests.AccessCodesDeleteRequest; +import com.seam.api.resources.accesscodes.requests.AccessCodesGenerateCodeRequest; import com.seam.api.resources.accesscodes.requests.AccessCodesGetRequest; import com.seam.api.resources.accesscodes.requests.AccessCodesListRequest; import com.seam.api.resources.accesscodes.requests.AccessCodesPullBackupAccessCodeRequest; import com.seam.api.resources.accesscodes.requests.AccessCodesUpdateRequest; import com.seam.api.resources.accesscodes.simulate.SimulateClient; +import com.seam.api.resources.accesscodes.types.AccessCodesCreateMultipleResponse; +import com.seam.api.resources.accesscodes.types.AccessCodesCreateResponse; +import com.seam.api.resources.accesscodes.types.AccessCodesDeleteResponse; +import com.seam.api.resources.accesscodes.types.AccessCodesGenerateCodeResponse; +import com.seam.api.resources.accesscodes.types.AccessCodesGetResponse; +import com.seam.api.resources.accesscodes.types.AccessCodesListResponse; +import com.seam.api.resources.accesscodes.types.AccessCodesPullBackupAccessCodeResponse; +import com.seam.api.resources.accesscodes.types.AccessCodesUpdateResponse; import com.seam.api.resources.accesscodes.unmanaged.UnmanagedClient; import com.seam.api.types.AccessCode; -import com.seam.api.types.AccessCodesCreateMultipleResponse; -import com.seam.api.types.AccessCodesCreateResponse; -import com.seam.api.types.AccessCodesDeleteResponse; -import com.seam.api.types.AccessCodesGetResponse; -import com.seam.api.types.AccessCodesListResponse; -import com.seam.api.types.AccessCodesPullBackupAccessCodeResponse; -import com.seam.api.types.AccessCodesUpdateResponse; -import com.seam.api.types.ActionAttempt; import java.io.IOException; import java.util.List; import java.util.function.Supplier; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class AccessCodesClient { protected final ClientOptions clientOptions; @@ -61,9 +68,9 @@ public AccessCode create(AccessCodesCreateRequest request, RequestOptions reques RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -71,19 +78,36 @@ public AccessCode create(AccessCodesCreateRequest request, RequestOptions reques .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { AccessCodesCreateResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), AccessCodesCreateResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessCodesCreateResponse.class); return parsedResponse.getAccessCode(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -99,9 +123,9 @@ public List createMultiple(AccessCodesCreateMultipleRequest request, RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -109,27 +133,44 @@ public List createMultiple(AccessCodesCreateMultipleRequest request, .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { AccessCodesCreateMultipleResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), AccessCodesCreateMultipleResponse.class); + responseBody.string(), AccessCodesCreateMultipleResponse.class); return parsedResponse.getAccessCodes(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ActionAttempt delete(AccessCodesDeleteRequest request) { + public AccessCodesDeleteResponse delete(AccessCodesDeleteRequest request) { return delete(request, null); } - public ActionAttempt delete(AccessCodesDeleteRequest request, RequestOptions requestOptions) { + public AccessCodesDeleteResponse delete(AccessCodesDeleteRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("access_codes/delete") @@ -137,9 +178,9 @@ public ActionAttempt delete(AccessCodesDeleteRequest request, RequestOptions req RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -147,24 +188,94 @@ public ActionAttempt delete(AccessCodesDeleteRequest request, RequestOptions req .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessCodesDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public AccessCode generateCode(AccessCodesGenerateCodeRequest request) { + return generateCode(request, null); + } + + public AccessCode generateCode(AccessCodesGenerateCodeRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("access_codes/generate_code") + .build(); + RequestBody body; try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - AccessCodesDeleteResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), AccessCodesDeleteResponse.class); - return parsedResponse.getActionAttempt(); + AccessCodesGenerateCodeResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AccessCodesGenerateCodeResponse.class); + return parsedResponse.getGeneratedCode(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public AccessCode getById(String accessCodeId) { - return get(AccessCodesGetRequest.builder().accessCodeId(accessCodeId).build()); + public AccessCode get() { + return get(AccessCodesGetRequest.builder().build()); } public AccessCode get(AccessCodesGetRequest request) { @@ -179,9 +290,9 @@ public AccessCode get(AccessCodesGetRequest request, RequestOptions requestOptio RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -189,26 +300,39 @@ public AccessCode get(AccessCodesGetRequest request, RequestOptions requestOptio .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { AccessCodesGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), AccessCodesGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessCodesGetResponse.class); return parsedResponse.getAccessCode(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public AccessCode get() { - return get(AccessCodesGetRequest.builder().build()); - } - public List list(AccessCodesListRequest request) { return list(request, null); } @@ -221,9 +345,9 @@ public List list(AccessCodesListRequest request, RequestOptions requ RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -231,19 +355,36 @@ public List list(AccessCodesListRequest request, RequestOptions requ .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { AccessCodesListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), AccessCodesListResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessCodesListResponse.class); return parsedResponse.getAccessCodes(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -260,9 +401,9 @@ public AccessCode pullBackupAccessCode( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -270,27 +411,44 @@ public AccessCode pullBackupAccessCode( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - AccessCodesPullBackupAccessCodeResponse parsedResposne = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), AccessCodesPullBackupAccessCodeResponse.class); - return parsedResposne.getBackupAccessCode(); + AccessCodesPullBackupAccessCodeResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AccessCodesPullBackupAccessCodeResponse.class); + return parsedResponse.getBackupAccessCode(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ActionAttempt update(AccessCodesUpdateRequest request) { + public AccessCodesUpdateResponse update(AccessCodesUpdateRequest request) { return update(request, null); } - public ActionAttempt update(AccessCodesUpdateRequest request, RequestOptions requestOptions) { + public AccessCodesUpdateResponse update(AccessCodesUpdateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("access_codes/update") @@ -298,9 +456,9 @@ public ActionAttempt update(AccessCodesUpdateRequest request, RequestOptions req RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -308,19 +466,34 @@ public ActionAttempt update(AccessCodesUpdateRequest request, RequestOptions req .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - AccessCodesUpdateResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), AccessCodesUpdateResponse.class); - return parsedResponse.getActionAttempt(); + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessCodesUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateMultipleRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateMultipleRequest.java index 7a27ccb..e9aeafc 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateMultipleRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateMultipleRequest.java @@ -12,7 +12,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared; +import com.seam.api.resources.accesscodes.types.AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared; +import com.seam.api.types.MaxTimeRounding; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -28,6 +29,8 @@ public final class AccessCodesCreateMultipleRequest { private final Optional behaviorWhenCodeCannotBeShared; + private final Optional preferredCodeLength; + private final Optional name; private final Optional startsAt; @@ -42,11 +45,24 @@ public final class AccessCodesCreateMultipleRequest { private final Optional useBackupAccessCodePool; + private final Optional allowExternalModification; + + private final Optional isExternalModificationAllowed; + + private final Optional useOfflineAccessCode; + + private final Optional isOfflineAccessCode; + + private final Optional isOneTimeUse; + + private final Optional maxTimeRounding; + private final Map additionalProperties; private AccessCodesCreateMultipleRequest( List deviceIds, Optional behaviorWhenCodeCannotBeShared, + Optional preferredCodeLength, Optional name, Optional startsAt, Optional endsAt, @@ -54,9 +70,16 @@ private AccessCodesCreateMultipleRequest( Optional attemptForOfflineDevice, Optional preferNativeScheduling, Optional useBackupAccessCodePool, + Optional allowExternalModification, + Optional isExternalModificationAllowed, + Optional useOfflineAccessCode, + Optional isOfflineAccessCode, + Optional isOneTimeUse, + Optional maxTimeRounding, Map additionalProperties) { this.deviceIds = deviceIds; this.behaviorWhenCodeCannotBeShared = behaviorWhenCodeCannotBeShared; + this.preferredCodeLength = preferredCodeLength; this.name = name; this.startsAt = startsAt; this.endsAt = endsAt; @@ -64,6 +87,12 @@ private AccessCodesCreateMultipleRequest( this.attemptForOfflineDevice = attemptForOfflineDevice; this.preferNativeScheduling = preferNativeScheduling; this.useBackupAccessCodePool = useBackupAccessCodePool; + this.allowExternalModification = allowExternalModification; + this.isExternalModificationAllowed = isExternalModificationAllowed; + this.useOfflineAccessCode = useOfflineAccessCode; + this.isOfflineAccessCode = isOfflineAccessCode; + this.isOneTimeUse = isOneTimeUse; + this.maxTimeRounding = maxTimeRounding; this.additionalProperties = additionalProperties; } @@ -78,6 +107,11 @@ public List getDeviceIds() { return behaviorWhenCodeCannotBeShared; } + @JsonProperty("preferred_code_length") + public Optional getPreferredCodeLength() { + return preferredCodeLength; + } + @JsonProperty("name") public Optional getName() { return name; @@ -113,7 +147,37 @@ public Optional getUseBackupAccessCodePool() { return useBackupAccessCodePool; } - @Override + @JsonProperty("allow_external_modification") + public Optional getAllowExternalModification() { + return allowExternalModification; + } + + @JsonProperty("is_external_modification_allowed") + public Optional getIsExternalModificationAllowed() { + return isExternalModificationAllowed; + } + + @JsonProperty("use_offline_access_code") + public Optional getUseOfflineAccessCode() { + return useOfflineAccessCode; + } + + @JsonProperty("is_offline_access_code") + public Optional getIsOfflineAccessCode() { + return isOfflineAccessCode; + } + + @JsonProperty("is_one_time_use") + public Optional getIsOneTimeUse() { + return isOneTimeUse; + } + + @JsonProperty("max_time_rounding") + public Optional getMaxTimeRounding() { + return maxTimeRounding; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesCreateMultipleRequest && equalTo((AccessCodesCreateMultipleRequest) other); @@ -127,30 +191,44 @@ public Map getAdditionalProperties() { private boolean equalTo(AccessCodesCreateMultipleRequest other) { return deviceIds.equals(other.deviceIds) && behaviorWhenCodeCannotBeShared.equals(other.behaviorWhenCodeCannotBeShared) + && preferredCodeLength.equals(other.preferredCodeLength) && name.equals(other.name) && startsAt.equals(other.startsAt) && endsAt.equals(other.endsAt) && code.equals(other.code) && attemptForOfflineDevice.equals(other.attemptForOfflineDevice) && preferNativeScheduling.equals(other.preferNativeScheduling) - && useBackupAccessCodePool.equals(other.useBackupAccessCodePool); + && useBackupAccessCodePool.equals(other.useBackupAccessCodePool) + && allowExternalModification.equals(other.allowExternalModification) + && isExternalModificationAllowed.equals(other.isExternalModificationAllowed) + && useOfflineAccessCode.equals(other.useOfflineAccessCode) + && isOfflineAccessCode.equals(other.isOfflineAccessCode) + && isOneTimeUse.equals(other.isOneTimeUse) + && maxTimeRounding.equals(other.maxTimeRounding); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.deviceIds, this.behaviorWhenCodeCannotBeShared, + this.preferredCodeLength, this.name, this.startsAt, this.endsAt, this.code, this.attemptForOfflineDevice, this.preferNativeScheduling, - this.useBackupAccessCodePool); + this.useBackupAccessCodePool, + this.allowExternalModification, + this.isExternalModificationAllowed, + this.useOfflineAccessCode, + this.isOfflineAccessCode, + this.isOneTimeUse, + this.maxTimeRounding); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -166,6 +244,8 @@ public static final class Builder { private Optional behaviorWhenCodeCannotBeShared = Optional.empty(); + private Optional preferredCodeLength = Optional.empty(); + private Optional name = Optional.empty(); private Optional startsAt = Optional.empty(); @@ -180,6 +260,18 @@ public static final class Builder { private Optional useBackupAccessCodePool = Optional.empty(); + private Optional allowExternalModification = Optional.empty(); + + private Optional isExternalModificationAllowed = Optional.empty(); + + private Optional useOfflineAccessCode = Optional.empty(); + + private Optional isOfflineAccessCode = Optional.empty(); + + private Optional isOneTimeUse = Optional.empty(); + + private Optional maxTimeRounding = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -188,6 +280,7 @@ private Builder() {} public Builder from(AccessCodesCreateMultipleRequest other) { deviceIds(other.getDeviceIds()); behaviorWhenCodeCannotBeShared(other.getBehaviorWhenCodeCannotBeShared()); + preferredCodeLength(other.getPreferredCodeLength()); name(other.getName()); startsAt(other.getStartsAt()); endsAt(other.getEndsAt()); @@ -195,6 +288,12 @@ public Builder from(AccessCodesCreateMultipleRequest other) { attemptForOfflineDevice(other.getAttemptForOfflineDevice()); preferNativeScheduling(other.getPreferNativeScheduling()); useBackupAccessCodePool(other.getUseBackupAccessCodePool()); + allowExternalModification(other.getAllowExternalModification()); + isExternalModificationAllowed(other.getIsExternalModificationAllowed()); + useOfflineAccessCode(other.getUseOfflineAccessCode()); + isOfflineAccessCode(other.getIsOfflineAccessCode()); + isOneTimeUse(other.getIsOneTimeUse()); + maxTimeRounding(other.getMaxTimeRounding()); return this; } @@ -229,6 +328,17 @@ public Builder behaviorWhenCodeCannotBeShared( return this; } + @JsonSetter(value = "preferred_code_length", nulls = Nulls.SKIP) + public Builder preferredCodeLength(Optional preferredCodeLength) { + this.preferredCodeLength = preferredCodeLength; + return this; + } + + public Builder preferredCodeLength(Double preferredCodeLength) { + this.preferredCodeLength = Optional.of(preferredCodeLength); + return this; + } + @JsonSetter(value = "name", nulls = Nulls.SKIP) public Builder name(Optional name) { this.name = name; @@ -306,10 +416,77 @@ public Builder useBackupAccessCodePool(Boolean useBackupAccessCodePool) { return this; } + @JsonSetter(value = "allow_external_modification", nulls = Nulls.SKIP) + public Builder allowExternalModification(Optional allowExternalModification) { + this.allowExternalModification = allowExternalModification; + return this; + } + + public Builder allowExternalModification(Boolean allowExternalModification) { + this.allowExternalModification = Optional.of(allowExternalModification); + return this; + } + + @JsonSetter(value = "is_external_modification_allowed", nulls = Nulls.SKIP) + public Builder isExternalModificationAllowed(Optional isExternalModificationAllowed) { + this.isExternalModificationAllowed = isExternalModificationAllowed; + return this; + } + + public Builder isExternalModificationAllowed(Boolean isExternalModificationAllowed) { + this.isExternalModificationAllowed = Optional.of(isExternalModificationAllowed); + return this; + } + + @JsonSetter(value = "use_offline_access_code", nulls = Nulls.SKIP) + public Builder useOfflineAccessCode(Optional useOfflineAccessCode) { + this.useOfflineAccessCode = useOfflineAccessCode; + return this; + } + + public Builder useOfflineAccessCode(Boolean useOfflineAccessCode) { + this.useOfflineAccessCode = Optional.of(useOfflineAccessCode); + return this; + } + + @JsonSetter(value = "is_offline_access_code", nulls = Nulls.SKIP) + public Builder isOfflineAccessCode(Optional isOfflineAccessCode) { + this.isOfflineAccessCode = isOfflineAccessCode; + return this; + } + + public Builder isOfflineAccessCode(Boolean isOfflineAccessCode) { + this.isOfflineAccessCode = Optional.of(isOfflineAccessCode); + return this; + } + + @JsonSetter(value = "is_one_time_use", nulls = Nulls.SKIP) + public Builder isOneTimeUse(Optional isOneTimeUse) { + this.isOneTimeUse = isOneTimeUse; + return this; + } + + public Builder isOneTimeUse(Boolean isOneTimeUse) { + this.isOneTimeUse = Optional.of(isOneTimeUse); + return this; + } + + @JsonSetter(value = "max_time_rounding", nulls = Nulls.SKIP) + public Builder maxTimeRounding(Optional maxTimeRounding) { + this.maxTimeRounding = maxTimeRounding; + return this; + } + + public Builder maxTimeRounding(MaxTimeRounding maxTimeRounding) { + this.maxTimeRounding = Optional.of(maxTimeRounding); + return this; + } + public AccessCodesCreateMultipleRequest build() { return new AccessCodesCreateMultipleRequest( deviceIds, behaviorWhenCodeCannotBeShared, + preferredCodeLength, name, startsAt, endsAt, @@ -317,6 +494,12 @@ public AccessCodesCreateMultipleRequest build() { attemptForOfflineDevice, preferNativeScheduling, useBackupAccessCodePool, + allowExternalModification, + isExternalModificationAllowed, + useOfflineAccessCode, + isOfflineAccessCode, + isOneTimeUse, + maxTimeRounding, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateRequest.java index caf4fac..3e85d6e 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesCreateRequest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.MaxTimeRounding; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,6 +41,18 @@ public final class AccessCodesCreateRequest { private final Optional useBackupAccessCodePool; + private final Optional allowExternalModification; + + private final Optional isExternalModificationAllowed; + + private final Optional useOfflineAccessCode; + + private final Optional isOfflineAccessCode; + + private final Optional isOneTimeUse; + + private final Optional maxTimeRounding; + private final Map additionalProperties; private AccessCodesCreateRequest( @@ -53,6 +66,12 @@ private AccessCodesCreateRequest( Optional commonCodeKey, Optional preferNativeScheduling, Optional useBackupAccessCodePool, + Optional allowExternalModification, + Optional isExternalModificationAllowed, + Optional useOfflineAccessCode, + Optional isOfflineAccessCode, + Optional isOneTimeUse, + Optional maxTimeRounding, Map additionalProperties) { this.deviceId = deviceId; this.name = name; @@ -64,6 +83,12 @@ private AccessCodesCreateRequest( this.commonCodeKey = commonCodeKey; this.preferNativeScheduling = preferNativeScheduling; this.useBackupAccessCodePool = useBackupAccessCodePool; + this.allowExternalModification = allowExternalModification; + this.isExternalModificationAllowed = isExternalModificationAllowed; + this.useOfflineAccessCode = useOfflineAccessCode; + this.isOfflineAccessCode = isOfflineAccessCode; + this.isOneTimeUse = isOneTimeUse; + this.maxTimeRounding = maxTimeRounding; this.additionalProperties = additionalProperties; } @@ -117,7 +142,37 @@ public Optional getUseBackupAccessCodePool() { return useBackupAccessCodePool; } - @Override + @JsonProperty("allow_external_modification") + public Optional getAllowExternalModification() { + return allowExternalModification; + } + + @JsonProperty("is_external_modification_allowed") + public Optional getIsExternalModificationAllowed() { + return isExternalModificationAllowed; + } + + @JsonProperty("use_offline_access_code") + public Optional getUseOfflineAccessCode() { + return useOfflineAccessCode; + } + + @JsonProperty("is_offline_access_code") + public Optional getIsOfflineAccessCode() { + return isOfflineAccessCode; + } + + @JsonProperty("is_one_time_use") + public Optional getIsOneTimeUse() { + return isOneTimeUse; + } + + @JsonProperty("max_time_rounding") + public Optional getMaxTimeRounding() { + return maxTimeRounding; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesCreateRequest && equalTo((AccessCodesCreateRequest) other); @@ -138,10 +193,16 @@ private boolean equalTo(AccessCodesCreateRequest other) { && attemptForOfflineDevice.equals(other.attemptForOfflineDevice) && commonCodeKey.equals(other.commonCodeKey) && preferNativeScheduling.equals(other.preferNativeScheduling) - && useBackupAccessCodePool.equals(other.useBackupAccessCodePool); + && useBackupAccessCodePool.equals(other.useBackupAccessCodePool) + && allowExternalModification.equals(other.allowExternalModification) + && isExternalModificationAllowed.equals(other.isExternalModificationAllowed) + && useOfflineAccessCode.equals(other.useOfflineAccessCode) + && isOfflineAccessCode.equals(other.isOfflineAccessCode) + && isOneTimeUse.equals(other.isOneTimeUse) + && maxTimeRounding.equals(other.maxTimeRounding); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.deviceId, @@ -153,10 +214,16 @@ public int hashCode() { this.attemptForOfflineDevice, this.commonCodeKey, this.preferNativeScheduling, - this.useBackupAccessCodePool); + this.useBackupAccessCodePool, + this.allowExternalModification, + this.isExternalModificationAllowed, + this.useOfflineAccessCode, + this.isOfflineAccessCode, + this.isOneTimeUse, + this.maxTimeRounding); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -209,12 +276,48 @@ public interface _FinalStage { _FinalStage useBackupAccessCodePool(Optional useBackupAccessCodePool); _FinalStage useBackupAccessCodePool(Boolean useBackupAccessCodePool); + + _FinalStage allowExternalModification(Optional allowExternalModification); + + _FinalStage allowExternalModification(Boolean allowExternalModification); + + _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed); + + _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed); + + _FinalStage useOfflineAccessCode(Optional useOfflineAccessCode); + + _FinalStage useOfflineAccessCode(Boolean useOfflineAccessCode); + + _FinalStage isOfflineAccessCode(Optional isOfflineAccessCode); + + _FinalStage isOfflineAccessCode(Boolean isOfflineAccessCode); + + _FinalStage isOneTimeUse(Optional isOneTimeUse); + + _FinalStage isOneTimeUse(Boolean isOneTimeUse); + + _FinalStage maxTimeRounding(Optional maxTimeRounding); + + _FinalStage maxTimeRounding(MaxTimeRounding maxTimeRounding); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceIdStage, _FinalStage { private String deviceId; + private Optional maxTimeRounding = Optional.empty(); + + private Optional isOneTimeUse = Optional.empty(); + + private Optional isOfflineAccessCode = Optional.empty(); + + private Optional useOfflineAccessCode = Optional.empty(); + + private Optional isExternalModificationAllowed = Optional.empty(); + + private Optional allowExternalModification = Optional.empty(); + private Optional useBackupAccessCodePool = Optional.empty(); private Optional preferNativeScheduling = Optional.empty(); @@ -238,7 +341,7 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesCreateRequest other) { deviceId(other.getDeviceId()); name(other.getName()); @@ -250,134 +353,218 @@ public Builder from(AccessCodesCreateRequest other) { commonCodeKey(other.getCommonCodeKey()); preferNativeScheduling(other.getPreferNativeScheduling()); useBackupAccessCodePool(other.getUseBackupAccessCodePool()); + allowExternalModification(other.getAllowExternalModification()); + isExternalModificationAllowed(other.getIsExternalModificationAllowed()); + useOfflineAccessCode(other.getUseOfflineAccessCode()); + isOfflineAccessCode(other.getIsOfflineAccessCode()); + isOneTimeUse(other.getIsOneTimeUse()); + maxTimeRounding(other.getMaxTimeRounding()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override + public _FinalStage maxTimeRounding(MaxTimeRounding maxTimeRounding) { + this.maxTimeRounding = Optional.of(maxTimeRounding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "max_time_rounding", nulls = Nulls.SKIP) + public _FinalStage maxTimeRounding(Optional maxTimeRounding) { + this.maxTimeRounding = maxTimeRounding; + return this; + } + + @java.lang.Override + public _FinalStage isOneTimeUse(Boolean isOneTimeUse) { + this.isOneTimeUse = Optional.of(isOneTimeUse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_one_time_use", nulls = Nulls.SKIP) + public _FinalStage isOneTimeUse(Optional isOneTimeUse) { + this.isOneTimeUse = isOneTimeUse; + return this; + } + + @java.lang.Override + public _FinalStage isOfflineAccessCode(Boolean isOfflineAccessCode) { + this.isOfflineAccessCode = Optional.of(isOfflineAccessCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_offline_access_code", nulls = Nulls.SKIP) + public _FinalStage isOfflineAccessCode(Optional isOfflineAccessCode) { + this.isOfflineAccessCode = isOfflineAccessCode; + return this; + } + + @java.lang.Override + public _FinalStage useOfflineAccessCode(Boolean useOfflineAccessCode) { + this.useOfflineAccessCode = Optional.of(useOfflineAccessCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "use_offline_access_code", nulls = Nulls.SKIP) + public _FinalStage useOfflineAccessCode(Optional useOfflineAccessCode) { + this.useOfflineAccessCode = useOfflineAccessCode; + return this; + } + + @java.lang.Override + public _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed) { + this.isExternalModificationAllowed = Optional.of(isExternalModificationAllowed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_external_modification_allowed", nulls = Nulls.SKIP) + public _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed) { + this.isExternalModificationAllowed = isExternalModificationAllowed; + return this; + } + + @java.lang.Override + public _FinalStage allowExternalModification(Boolean allowExternalModification) { + this.allowExternalModification = Optional.of(allowExternalModification); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_external_modification", nulls = Nulls.SKIP) + public _FinalStage allowExternalModification(Optional allowExternalModification) { + this.allowExternalModification = allowExternalModification; + return this; + } + + @java.lang.Override public _FinalStage useBackupAccessCodePool(Boolean useBackupAccessCodePool) { this.useBackupAccessCodePool = Optional.of(useBackupAccessCodePool); return this; } - @Override + @java.lang.Override @JsonSetter(value = "use_backup_access_code_pool", nulls = Nulls.SKIP) public _FinalStage useBackupAccessCodePool(Optional useBackupAccessCodePool) { this.useBackupAccessCodePool = useBackupAccessCodePool; return this; } - @Override + @java.lang.Override public _FinalStage preferNativeScheduling(Boolean preferNativeScheduling) { this.preferNativeScheduling = Optional.of(preferNativeScheduling); return this; } - @Override + @java.lang.Override @JsonSetter(value = "prefer_native_scheduling", nulls = Nulls.SKIP) public _FinalStage preferNativeScheduling(Optional preferNativeScheduling) { this.preferNativeScheduling = preferNativeScheduling; return this; } - @Override + @java.lang.Override public _FinalStage commonCodeKey(String commonCodeKey) { this.commonCodeKey = Optional.of(commonCodeKey); return this; } - @Override + @java.lang.Override @JsonSetter(value = "common_code_key", nulls = Nulls.SKIP) public _FinalStage commonCodeKey(Optional commonCodeKey) { this.commonCodeKey = commonCodeKey; return this; } - @Override + @java.lang.Override public _FinalStage attemptForOfflineDevice(Boolean attemptForOfflineDevice) { this.attemptForOfflineDevice = Optional.of(attemptForOfflineDevice); return this; } - @Override + @java.lang.Override @JsonSetter(value = "attempt_for_offline_device", nulls = Nulls.SKIP) public _FinalStage attemptForOfflineDevice(Optional attemptForOfflineDevice) { this.attemptForOfflineDevice = attemptForOfflineDevice; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public _FinalStage code(String code) { this.code = Optional.of(code); return this; } - @Override + @java.lang.Override @JsonSetter(value = "code", nulls = Nulls.SKIP) public _FinalStage code(Optional code) { this.code = code; return this; } - @Override + @java.lang.Override public _FinalStage endsAt(String endsAt) { this.endsAt = Optional.of(endsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) public _FinalStage endsAt(Optional endsAt) { this.endsAt = endsAt; return this; } - @Override + @java.lang.Override public _FinalStage startsAt(String startsAt) { this.startsAt = Optional.of(startsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) public _FinalStage startsAt(Optional startsAt) { this.startsAt = startsAt; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public AccessCodesCreateRequest build() { return new AccessCodesCreateRequest( deviceId, @@ -390,6 +577,12 @@ public AccessCodesCreateRequest build() { commonCodeKey, preferNativeScheduling, useBackupAccessCodePool, + allowExternalModification, + isExternalModificationAllowed, + useOfflineAccessCode, + isOfflineAccessCode, + isOneTimeUse, + maxTimeRounding, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesDeleteRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesDeleteRequest.java index 49827e3..1e122c1 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesDeleteRequest.java @@ -54,7 +54,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesDeleteRequest && equalTo((AccessCodesDeleteRequest) other); @@ -69,12 +69,12 @@ private boolean equalTo(AccessCodesDeleteRequest other) { return deviceId.equals(other.deviceId) && accessCodeId.equals(other.accessCodeId) && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.accessCodeId, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -114,7 +114,7 @@ public static final class Builder implements AccessCodeIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesDeleteRequest other) { deviceId(other.getDeviceId()); accessCodeId(other.getAccessCodeId()); @@ -122,40 +122,40 @@ public Builder from(AccessCodesDeleteRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("access_code_id") public _FinalStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public _FinalStage deviceId(String deviceId) { this.deviceId = Optional.of(deviceId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "device_id", nulls = Nulls.SKIP) public _FinalStage deviceId(Optional deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public AccessCodesDeleteRequest build() { return new AccessCodesDeleteRequest(deviceId, accessCodeId, sync, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGenerateCodeRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGenerateCodeRequest.java new file mode 100644 index 0000000..51ccaf9 --- /dev/null +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGenerateCodeRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.accesscodes.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessCodesGenerateCodeRequest.Builder.class) +public final class AccessCodesGenerateCodeRequest { + private final String deviceId; + + private final Map additionalProperties; + + private AccessCodesGenerateCodeRequest(String deviceId, Map additionalProperties) { + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessCodesGenerateCodeRequest && equalTo((AccessCodesGenerateCodeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessCodesGenerateCodeRequest other) { + return deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + + Builder from(AccessCodesGenerateCodeRequest other); + } + + public interface _FinalStage { + AccessCodesGenerateCodeRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessCodesGenerateCodeRequest other) { + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public AccessCodesGenerateCodeRequest build() { + return new AccessCodesGenerateCodeRequest(deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGetRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGetRequest.java index 2be927e..5971400 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGetRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesGetRequest.java @@ -54,7 +54,7 @@ public Optional getCode() { return code; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesGetRequest && equalTo((AccessCodesGetRequest) other); @@ -69,12 +69,12 @@ private boolean equalTo(AccessCodesGetRequest other) { return deviceId.equals(other.deviceId) && accessCodeId.equals(other.accessCodeId) && code.equals(other.code); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.accessCodeId, this.code); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesListRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesListRequest.java index 71ff965..e8675db 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesListRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesListRequest.java @@ -25,12 +25,18 @@ public final class AccessCodesListRequest { private final Optional> accessCodeIds; + private final Optional userIdentifierKey; + private final Map additionalProperties; private AccessCodesListRequest( - String deviceId, Optional> accessCodeIds, Map additionalProperties) { + String deviceId, + Optional> accessCodeIds, + Optional userIdentifierKey, + Map additionalProperties) { this.deviceId = deviceId; this.accessCodeIds = accessCodeIds; + this.userIdentifierKey = userIdentifierKey; this.additionalProperties = additionalProperties; } @@ -44,7 +50,12 @@ public Optional> getAccessCodeIds() { return accessCodeIds; } - @Override + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesListRequest && equalTo((AccessCodesListRequest) other); @@ -56,15 +67,17 @@ public Map getAdditionalProperties() { } private boolean equalTo(AccessCodesListRequest other) { - return deviceId.equals(other.deviceId) && accessCodeIds.equals(other.accessCodeIds); + return deviceId.equals(other.deviceId) + && accessCodeIds.equals(other.accessCodeIds) + && userIdentifierKey.equals(other.userIdentifierKey); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.deviceId, this.accessCodeIds); + return Objects.hash(this.deviceId, this.accessCodeIds, this.userIdentifierKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -85,12 +98,18 @@ public interface _FinalStage { _FinalStage accessCodeIds(Optional> accessCodeIds); _FinalStage accessCodeIds(List accessCodeIds); + + _FinalStage userIdentifierKey(Optional userIdentifierKey); + + _FinalStage userIdentifierKey(String userIdentifierKey); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceIdStage, _FinalStage { private String deviceId; + private Optional userIdentifierKey = Optional.empty(); + private Optional> accessCodeIds = Optional.empty(); @JsonAnySetter @@ -98,36 +117,50 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesListRequest other) { deviceId(other.getDeviceId()); accessCodeIds(other.getAccessCodeIds()); + userIdentifierKey(other.getUserIdentifierKey()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override + public _FinalStage userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public _FinalStage userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + @java.lang.Override public _FinalStage accessCodeIds(List accessCodeIds) { this.accessCodeIds = Optional.of(accessCodeIds); return this; } - @Override + @java.lang.Override @JsonSetter(value = "access_code_ids", nulls = Nulls.SKIP) public _FinalStage accessCodeIds(Optional> accessCodeIds) { this.accessCodeIds = accessCodeIds; return this; } - @Override + @java.lang.Override public AccessCodesListRequest build() { - return new AccessCodesListRequest(deviceId, accessCodeIds, additionalProperties); + return new AccessCodesListRequest(deviceId, accessCodeIds, userIdentifierKey, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesPullBackupAccessCodeRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesPullBackupAccessCodeRequest.java index e92e04d..3bc9559 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesPullBackupAccessCodeRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesPullBackupAccessCodeRequest.java @@ -32,7 +32,7 @@ public String getAccessCodeId() { return accessCodeId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesPullBackupAccessCodeRequest @@ -48,12 +48,12 @@ private boolean equalTo(AccessCodesPullBackupAccessCodeRequest other) { return accessCodeId.equals(other.accessCodeId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessCodeId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements AccessCodeIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesPullBackupAccessCodeRequest other) { accessCodeId(other.getAccessCodeId()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code_id") public _FinalStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + @java.lang.Override public AccessCodesPullBackupAccessCodeRequest build() { return new AccessCodesPullBackupAccessCodeRequest(accessCodeId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesUpdateRequest.java b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesUpdateRequest.java index 5b70ad1..d5c02df 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesUpdateRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/requests/AccessCodesUpdateRequest.java @@ -12,7 +12,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.AccessCodesUpdateRequestType; +import com.seam.api.resources.accesscodes.types.AccessCodesUpdateRequestType; +import com.seam.api.types.MaxTimeRounding; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -37,12 +38,26 @@ public final class AccessCodesUpdateRequest { private final Optional useBackupAccessCodePool; + private final Optional allowExternalModification; + + private final Optional isExternalModificationAllowed; + + private final Optional useOfflineAccessCode; + + private final Optional isOfflineAccessCode; + + private final Optional isOneTimeUse; + + private final Optional maxTimeRounding; + private final String accessCodeId; private final Optional deviceId; private final Optional type; + private final Optional isManaged; + private final Map additionalProperties; private AccessCodesUpdateRequest( @@ -54,9 +69,16 @@ private AccessCodesUpdateRequest( Optional attemptForOfflineDevice, Optional preferNativeScheduling, Optional useBackupAccessCodePool, + Optional allowExternalModification, + Optional isExternalModificationAllowed, + Optional useOfflineAccessCode, + Optional isOfflineAccessCode, + Optional isOneTimeUse, + Optional maxTimeRounding, String accessCodeId, Optional deviceId, Optional type, + Optional isManaged, Map additionalProperties) { this.name = name; this.startsAt = startsAt; @@ -66,9 +88,16 @@ private AccessCodesUpdateRequest( this.attemptForOfflineDevice = attemptForOfflineDevice; this.preferNativeScheduling = preferNativeScheduling; this.useBackupAccessCodePool = useBackupAccessCodePool; + this.allowExternalModification = allowExternalModification; + this.isExternalModificationAllowed = isExternalModificationAllowed; + this.useOfflineAccessCode = useOfflineAccessCode; + this.isOfflineAccessCode = isOfflineAccessCode; + this.isOneTimeUse = isOneTimeUse; + this.maxTimeRounding = maxTimeRounding; this.accessCodeId = accessCodeId; this.deviceId = deviceId; this.type = type; + this.isManaged = isManaged; this.additionalProperties = additionalProperties; } @@ -112,6 +141,36 @@ public Optional getUseBackupAccessCodePool() { return useBackupAccessCodePool; } + @JsonProperty("allow_external_modification") + public Optional getAllowExternalModification() { + return allowExternalModification; + } + + @JsonProperty("is_external_modification_allowed") + public Optional getIsExternalModificationAllowed() { + return isExternalModificationAllowed; + } + + @JsonProperty("use_offline_access_code") + public Optional getUseOfflineAccessCode() { + return useOfflineAccessCode; + } + + @JsonProperty("is_offline_access_code") + public Optional getIsOfflineAccessCode() { + return isOfflineAccessCode; + } + + @JsonProperty("is_one_time_use") + public Optional getIsOneTimeUse() { + return isOneTimeUse; + } + + @JsonProperty("max_time_rounding") + public Optional getMaxTimeRounding() { + return maxTimeRounding; + } + @JsonProperty("access_code_id") public String getAccessCodeId() { return accessCodeId; @@ -127,7 +186,12 @@ public Optional getType() { return type; } - @Override + @JsonProperty("is_managed") + public Optional getIsManaged() { + return isManaged; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesUpdateRequest && equalTo((AccessCodesUpdateRequest) other); @@ -147,12 +211,19 @@ private boolean equalTo(AccessCodesUpdateRequest other) { && attemptForOfflineDevice.equals(other.attemptForOfflineDevice) && preferNativeScheduling.equals(other.preferNativeScheduling) && useBackupAccessCodePool.equals(other.useBackupAccessCodePool) + && allowExternalModification.equals(other.allowExternalModification) + && isExternalModificationAllowed.equals(other.isExternalModificationAllowed) + && useOfflineAccessCode.equals(other.useOfflineAccessCode) + && isOfflineAccessCode.equals(other.isOfflineAccessCode) + && isOneTimeUse.equals(other.isOneTimeUse) + && maxTimeRounding.equals(other.maxTimeRounding) && accessCodeId.equals(other.accessCodeId) && deviceId.equals(other.deviceId) - && type.equals(other.type); + && type.equals(other.type) + && isManaged.equals(other.isManaged); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.name, @@ -163,12 +234,19 @@ public int hashCode() { this.attemptForOfflineDevice, this.preferNativeScheduling, this.useBackupAccessCodePool, + this.allowExternalModification, + this.isExternalModificationAllowed, + this.useOfflineAccessCode, + this.isOfflineAccessCode, + this.isOneTimeUse, + this.maxTimeRounding, this.accessCodeId, this.deviceId, - this.type); + this.type, + this.isManaged); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -218,6 +296,30 @@ public interface _FinalStage { _FinalStage useBackupAccessCodePool(Boolean useBackupAccessCodePool); + _FinalStage allowExternalModification(Optional allowExternalModification); + + _FinalStage allowExternalModification(Boolean allowExternalModification); + + _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed); + + _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed); + + _FinalStage useOfflineAccessCode(Optional useOfflineAccessCode); + + _FinalStage useOfflineAccessCode(Boolean useOfflineAccessCode); + + _FinalStage isOfflineAccessCode(Optional isOfflineAccessCode); + + _FinalStage isOfflineAccessCode(Boolean isOfflineAccessCode); + + _FinalStage isOneTimeUse(Optional isOneTimeUse); + + _FinalStage isOneTimeUse(Boolean isOneTimeUse); + + _FinalStage maxTimeRounding(Optional maxTimeRounding); + + _FinalStage maxTimeRounding(MaxTimeRounding maxTimeRounding); + _FinalStage deviceId(Optional deviceId); _FinalStage deviceId(String deviceId); @@ -225,16 +327,34 @@ public interface _FinalStage { _FinalStage type(Optional type); _FinalStage type(AccessCodesUpdateRequestType type); + + _FinalStage isManaged(Optional isManaged); + + _FinalStage isManaged(Boolean isManaged); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements AccessCodeIdStage, _FinalStage { private String accessCodeId; + private Optional isManaged = Optional.empty(); + private Optional type = Optional.empty(); private Optional deviceId = Optional.empty(); + private Optional maxTimeRounding = Optional.empty(); + + private Optional isOneTimeUse = Optional.empty(); + + private Optional isOfflineAccessCode = Optional.empty(); + + private Optional useOfflineAccessCode = Optional.empty(); + + private Optional isExternalModificationAllowed = Optional.empty(); + + private Optional allowExternalModification = Optional.empty(); + private Optional useBackupAccessCodePool = Optional.empty(); private Optional preferNativeScheduling = Optional.empty(); @@ -256,7 +376,7 @@ public static final class Builder implements AccessCodeIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesUpdateRequest other) { name(other.getName()); startsAt(other.getStartsAt()); @@ -266,150 +386,248 @@ public Builder from(AccessCodesUpdateRequest other) { attemptForOfflineDevice(other.getAttemptForOfflineDevice()); preferNativeScheduling(other.getPreferNativeScheduling()); useBackupAccessCodePool(other.getUseBackupAccessCodePool()); + allowExternalModification(other.getAllowExternalModification()); + isExternalModificationAllowed(other.getIsExternalModificationAllowed()); + useOfflineAccessCode(other.getUseOfflineAccessCode()); + isOfflineAccessCode(other.getIsOfflineAccessCode()); + isOneTimeUse(other.getIsOneTimeUse()); + maxTimeRounding(other.getMaxTimeRounding()); accessCodeId(other.getAccessCodeId()); deviceId(other.getDeviceId()); type(other.getType()); + isManaged(other.getIsManaged()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code_id") public _FinalStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + @java.lang.Override + public _FinalStage isManaged(Boolean isManaged) { + this.isManaged = Optional.of(isManaged); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_managed", nulls = Nulls.SKIP) + public _FinalStage isManaged(Optional isManaged) { + this.isManaged = isManaged; + return this; + } + + @java.lang.Override public _FinalStage type(AccessCodesUpdateRequestType type) { this.type = Optional.of(type); return this; } - @Override + @java.lang.Override @JsonSetter(value = "type", nulls = Nulls.SKIP) public _FinalStage type(Optional type) { this.type = type; return this; } - @Override + @java.lang.Override public _FinalStage deviceId(String deviceId) { this.deviceId = Optional.of(deviceId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "device_id", nulls = Nulls.SKIP) public _FinalStage deviceId(Optional deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override + public _FinalStage maxTimeRounding(MaxTimeRounding maxTimeRounding) { + this.maxTimeRounding = Optional.of(maxTimeRounding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "max_time_rounding", nulls = Nulls.SKIP) + public _FinalStage maxTimeRounding(Optional maxTimeRounding) { + this.maxTimeRounding = maxTimeRounding; + return this; + } + + @java.lang.Override + public _FinalStage isOneTimeUse(Boolean isOneTimeUse) { + this.isOneTimeUse = Optional.of(isOneTimeUse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_one_time_use", nulls = Nulls.SKIP) + public _FinalStage isOneTimeUse(Optional isOneTimeUse) { + this.isOneTimeUse = isOneTimeUse; + return this; + } + + @java.lang.Override + public _FinalStage isOfflineAccessCode(Boolean isOfflineAccessCode) { + this.isOfflineAccessCode = Optional.of(isOfflineAccessCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_offline_access_code", nulls = Nulls.SKIP) + public _FinalStage isOfflineAccessCode(Optional isOfflineAccessCode) { + this.isOfflineAccessCode = isOfflineAccessCode; + return this; + } + + @java.lang.Override + public _FinalStage useOfflineAccessCode(Boolean useOfflineAccessCode) { + this.useOfflineAccessCode = Optional.of(useOfflineAccessCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "use_offline_access_code", nulls = Nulls.SKIP) + public _FinalStage useOfflineAccessCode(Optional useOfflineAccessCode) { + this.useOfflineAccessCode = useOfflineAccessCode; + return this; + } + + @java.lang.Override + public _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed) { + this.isExternalModificationAllowed = Optional.of(isExternalModificationAllowed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_external_modification_allowed", nulls = Nulls.SKIP) + public _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed) { + this.isExternalModificationAllowed = isExternalModificationAllowed; + return this; + } + + @java.lang.Override + public _FinalStage allowExternalModification(Boolean allowExternalModification) { + this.allowExternalModification = Optional.of(allowExternalModification); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_external_modification", nulls = Nulls.SKIP) + public _FinalStage allowExternalModification(Optional allowExternalModification) { + this.allowExternalModification = allowExternalModification; + return this; + } + + @java.lang.Override public _FinalStage useBackupAccessCodePool(Boolean useBackupAccessCodePool) { this.useBackupAccessCodePool = Optional.of(useBackupAccessCodePool); return this; } - @Override + @java.lang.Override @JsonSetter(value = "use_backup_access_code_pool", nulls = Nulls.SKIP) public _FinalStage useBackupAccessCodePool(Optional useBackupAccessCodePool) { this.useBackupAccessCodePool = useBackupAccessCodePool; return this; } - @Override + @java.lang.Override public _FinalStage preferNativeScheduling(Boolean preferNativeScheduling) { this.preferNativeScheduling = Optional.of(preferNativeScheduling); return this; } - @Override + @java.lang.Override @JsonSetter(value = "prefer_native_scheduling", nulls = Nulls.SKIP) public _FinalStage preferNativeScheduling(Optional preferNativeScheduling) { this.preferNativeScheduling = preferNativeScheduling; return this; } - @Override + @java.lang.Override public _FinalStage attemptForOfflineDevice(Boolean attemptForOfflineDevice) { this.attemptForOfflineDevice = Optional.of(attemptForOfflineDevice); return this; } - @Override + @java.lang.Override @JsonSetter(value = "attempt_for_offline_device", nulls = Nulls.SKIP) public _FinalStage attemptForOfflineDevice(Optional attemptForOfflineDevice) { this.attemptForOfflineDevice = attemptForOfflineDevice; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public _FinalStage code(String code) { this.code = Optional.of(code); return this; } - @Override + @java.lang.Override @JsonSetter(value = "code", nulls = Nulls.SKIP) public _FinalStage code(Optional code) { this.code = code; return this; } - @Override + @java.lang.Override public _FinalStage endsAt(String endsAt) { this.endsAt = Optional.of(endsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) public _FinalStage endsAt(Optional endsAt) { this.endsAt = endsAt; return this; } - @Override + @java.lang.Override public _FinalStage startsAt(String startsAt) { this.startsAt = Optional.of(startsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) public _FinalStage startsAt(Optional startsAt) { this.startsAt = startsAt; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public AccessCodesUpdateRequest build() { return new AccessCodesUpdateRequest( name, @@ -420,9 +638,16 @@ public AccessCodesUpdateRequest build() { attemptForOfflineDevice, preferNativeScheduling, useBackupAccessCodePool, + allowExternalModification, + isExternalModificationAllowed, + useOfflineAccessCode, + isOfflineAccessCode, + isOneTimeUse, + maxTimeRounding, accessCodeId, deviceId, type, + isManaged, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/simulate/SimulateClient.java b/src/main/java/com/seam/api/resources/accesscodes/simulate/SimulateClient.java index b4604a3..fa422a4 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/simulate/SimulateClient.java +++ b/src/main/java/com/seam/api/resources/accesscodes/simulate/SimulateClient.java @@ -3,19 +3,26 @@ */ package com.seam.api.resources.accesscodes.simulate; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.accesscodes.simulate.requests.SimulateCreateUnmanagedAccessCodeRequest; -import com.seam.api.types.SimulateCreateUnmanagedAccessCodeResponse; +import com.seam.api.resources.accesscodes.simulate.types.SimulateCreateUnmanagedAccessCodeResponse; +import com.seam.api.types.UnmanagedAccessCode; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class SimulateClient { protected final ClientOptions clientOptions; @@ -24,7 +31,11 @@ public SimulateClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public SimulateCreateUnmanagedAccessCodeResponse createUnmanagedAccessCode( + public UnmanagedAccessCode createUnmanagedAccessCode(SimulateCreateUnmanagedAccessCodeRequest request) { + return createUnmanagedAccessCode(request, null); + } + + public UnmanagedAccessCode createUnmanagedAccessCode( SimulateCreateUnmanagedAccessCodeRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -33,9 +44,9 @@ public SimulateCreateUnmanagedAccessCodeResponse createUnmanagedAccessCode( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -43,23 +54,36 @@ public SimulateCreateUnmanagedAccessCodeResponse createUnmanagedAccessCode( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), SimulateCreateUnmanagedAccessCodeResponse.class); + SimulateCreateUnmanagedAccessCodeResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), SimulateCreateUnmanagedAccessCodeResponse.class); + return parsedResponse.getAccessCode(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - - public SimulateCreateUnmanagedAccessCodeResponse createUnmanagedAccessCode( - SimulateCreateUnmanagedAccessCodeRequest request) { - return createUnmanagedAccessCode(request, null); - } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/simulate/requests/SimulateCreateUnmanagedAccessCodeRequest.java b/src/main/java/com/seam/api/resources/accesscodes/simulate/requests/SimulateCreateUnmanagedAccessCodeRequest.java index 83f85b7..7194ba2 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/simulate/requests/SimulateCreateUnmanagedAccessCodeRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/simulate/requests/SimulateCreateUnmanagedAccessCodeRequest.java @@ -49,7 +49,7 @@ public String getCode() { return code; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SimulateCreateUnmanagedAccessCodeRequest @@ -65,12 +65,12 @@ private boolean equalTo(SimulateCreateUnmanagedAccessCodeRequest other) { return deviceId.equals(other.deviceId) && name.equals(other.name) && code.equals(other.code); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.name, this.code); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -110,7 +110,7 @@ public static final class Builder implements DeviceIdStage, NameStage, CodeStage private Builder() {} - @Override + @java.lang.Override public Builder from(SimulateCreateUnmanagedAccessCodeRequest other) { deviceId(other.getDeviceId()); name(other.getName()); @@ -118,28 +118,28 @@ public Builder from(SimulateCreateUnmanagedAccessCodeRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public NameStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("name") public CodeStage name(String name) { this.name = name; return this; } - @Override + @java.lang.Override @JsonSetter("code") public _FinalStage code(String code) { this.code = code; return this; } - @Override + @java.lang.Override public SimulateCreateUnmanagedAccessCodeRequest build() { return new SimulateCreateUnmanagedAccessCodeRequest(deviceId, name, code, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponse.java b/src/main/java/com/seam/api/resources/accesscodes/simulate/types/SimulateCreateUnmanagedAccessCodeResponse.java similarity index 81% rename from src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/simulate/types/SimulateCreateUnmanagedAccessCodeResponse.java index 4524b04..94f114f 100644 --- a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/simulate/types/SimulateCreateUnmanagedAccessCodeResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.simulate.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UnmanagedAccessCode; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -18,23 +19,21 @@ @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = SimulateCreateUnmanagedAccessCodeResponse.Builder.class) public final class SimulateCreateUnmanagedAccessCodeResponse { - private final SimulateCreateUnmanagedAccessCodeResponseAccessCode accessCode; + private final UnmanagedAccessCode accessCode; private final boolean ok; private final Map additionalProperties; private SimulateCreateUnmanagedAccessCodeResponse( - SimulateCreateUnmanagedAccessCodeResponseAccessCode accessCode, - boolean ok, - Map additionalProperties) { + UnmanagedAccessCode accessCode, boolean ok, Map additionalProperties) { this.accessCode = accessCode; this.ok = ok; this.additionalProperties = additionalProperties; } @JsonProperty("access_code") - public SimulateCreateUnmanagedAccessCodeResponseAccessCode getAccessCode() { + public UnmanagedAccessCode getAccessCode() { return accessCode; } @@ -43,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SimulateCreateUnmanagedAccessCodeResponse @@ -59,12 +58,12 @@ private boolean equalTo(SimulateCreateUnmanagedAccessCodeResponse other) { return accessCode.equals(other.accessCode) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessCode, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -74,7 +73,7 @@ public static AccessCodeStage builder() { } public interface AccessCodeStage { - OkStage accessCode(SimulateCreateUnmanagedAccessCodeResponseAccessCode accessCode); + OkStage accessCode(UnmanagedAccessCode accessCode); Builder from(SimulateCreateUnmanagedAccessCodeResponse other); } @@ -89,7 +88,7 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements AccessCodeStage, OkStage, _FinalStage { - private SimulateCreateUnmanagedAccessCodeResponseAccessCode accessCode; + private UnmanagedAccessCode accessCode; private boolean ok; @@ -98,28 +97,28 @@ public static final class Builder implements AccessCodeStage, OkStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(SimulateCreateUnmanagedAccessCodeResponse other) { accessCode(other.getAccessCode()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code") - public OkStage accessCode(SimulateCreateUnmanagedAccessCodeResponseAccessCode accessCode) { + public OkStage accessCode(UnmanagedAccessCode accessCode) { this.accessCode = accessCode; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public SimulateCreateUnmanagedAccessCodeResponse build() { return new SimulateCreateUnmanagedAccessCodeResponse(accessCode, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared.java similarity index 87% rename from src/main/java/com/seam/api/types/AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared.java index 252e436..8db0bd6 100644 --- a/src/main/java/com/seam/api/types/AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,7 +17,7 @@ public enum AccessCodesCreateMultipleRequestBehaviorWhenCodeCannotBeShared { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/AccessCodesCreateMultipleResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateMultipleResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/AccessCodesCreateMultipleResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateMultipleResponse.java index a2d85c4..5fabdb4 100644 --- a/src/main/java/com/seam/api/types/AccessCodesCreateMultipleResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateMultipleResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AccessCode; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesCreateMultipleResponse && equalTo((AccessCodesCreateMultipleResponse) other); @@ -59,12 +60,12 @@ private boolean equalTo(AccessCodesCreateMultipleResponse other) { return accessCodes.equals(other.accessCodes) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessCodes, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,33 +101,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesCreateMultipleResponse other) { accessCodes(other.getAccessCodes()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllAccessCodes(List accessCodes) { this.accessCodes.addAll(accessCodes); return this; } - @Override + @java.lang.Override public _FinalStage addAccessCodes(AccessCode accessCodes) { this.accessCodes.add(accessCodes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "access_codes", nulls = Nulls.SKIP) public _FinalStage accessCodes(List accessCodes) { this.accessCodes.clear(); @@ -134,7 +135,7 @@ public _FinalStage accessCodes(List accessCodes) { return this; } - @Override + @java.lang.Override public AccessCodesCreateMultipleResponse build() { return new AccessCodesCreateMultipleResponse(accessCodes, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/AccessCodesCreateResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/AccessCodesCreateResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateResponse.java index 90d8617..3e14d38 100644 --- a/src/main/java/com/seam/api/types/AccessCodesCreateResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesCreateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,8 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AccessCode; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -49,7 +51,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesCreateResponse && equalTo((AccessCodesCreateResponse) other); @@ -64,12 +66,12 @@ private boolean equalTo(AccessCodesCreateResponse other) { return actionAttempt.equals(other.actionAttempt) && accessCode.equals(other.accessCode) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.accessCode, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +111,7 @@ public static final class Builder implements ActionAttemptStage, AccessCodeStage private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesCreateResponse other) { actionAttempt(other.getActionAttempt()); accessCode(other.getAccessCode()); @@ -117,28 +119,28 @@ public Builder from(AccessCodesCreateResponse other) { return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public AccessCodeStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("access_code") public OkStage accessCode(AccessCode accessCode) { this.accessCode = accessCode; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public AccessCodesCreateResponse build() { return new AccessCodesCreateResponse(actionAttempt, accessCode, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/AccessCodesDeleteResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/AccessCodesDeleteResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesDeleteResponse.java index 3fde1be..97ee315 100644 --- a/src/main/java/com/seam/api/types/AccessCodesDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesDeleteResponse && equalTo((AccessCodesDeleteResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(AccessCodesDeleteResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesDeleteResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public AccessCodesDeleteResponse build() { return new AccessCodesDeleteResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesGenerateCodeResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesGenerateCodeResponse.java new file mode 100644 index 0000000..97ea6df --- /dev/null +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesGenerateCodeResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.accesscodes.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AccessCode; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessCodesGenerateCodeResponse.Builder.class) +public final class AccessCodesGenerateCodeResponse { + private final AccessCode generatedCode; + + private final boolean ok; + + private final Map additionalProperties; + + private AccessCodesGenerateCodeResponse( + AccessCode generatedCode, boolean ok, Map additionalProperties) { + this.generatedCode = generatedCode; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("generated_code") + public AccessCode getGeneratedCode() { + return generatedCode; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessCodesGenerateCodeResponse && equalTo((AccessCodesGenerateCodeResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessCodesGenerateCodeResponse other) { + return generatedCode.equals(other.generatedCode) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.generatedCode, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static GeneratedCodeStage builder() { + return new Builder(); + } + + public interface GeneratedCodeStage { + OkStage generatedCode(AccessCode generatedCode); + + Builder from(AccessCodesGenerateCodeResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + AccessCodesGenerateCodeResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements GeneratedCodeStage, OkStage, _FinalStage { + private AccessCode generatedCode; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessCodesGenerateCodeResponse other) { + generatedCode(other.getGeneratedCode()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("generated_code") + public OkStage generatedCode(AccessCode generatedCode) { + this.generatedCode = generatedCode; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public AccessCodesGenerateCodeResponse build() { + return new AccessCodesGenerateCodeResponse(generatedCode, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AccessCodesGetResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/AccessCodesGetResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesGetResponse.java index 8448b28..74e39b6 100644 --- a/src/main/java/com/seam/api/types/AccessCodesGetResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AccessCode; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesGetResponse && equalTo((AccessCodesGetResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(AccessCodesGetResponse other) { return accessCode.equals(other.accessCode) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessCode, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements AccessCodeStage, OkStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesGetResponse other) { accessCode(other.getAccessCode()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code") public OkStage accessCode(AccessCode accessCode) { this.accessCode = accessCode; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public AccessCodesGetResponse build() { return new AccessCodesGetResponse(accessCode, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/AccessCodesListResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/AccessCodesListResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesListResponse.java index dac64d4..ae32aad 100644 --- a/src/main/java/com/seam/api/types/AccessCodesListResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AccessCode; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesListResponse && equalTo((AccessCodesListResponse) other); @@ -59,12 +60,12 @@ private boolean equalTo(AccessCodesListResponse other) { return accessCodes.equals(other.accessCodes) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessCodes, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,33 +101,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesListResponse other) { accessCodes(other.getAccessCodes()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllAccessCodes(List accessCodes) { this.accessCodes.addAll(accessCodes); return this; } - @Override + @java.lang.Override public _FinalStage addAccessCodes(AccessCode accessCodes) { this.accessCodes.add(accessCodes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "access_codes", nulls = Nulls.SKIP) public _FinalStage accessCodes(List accessCodes) { this.accessCodes.clear(); @@ -134,7 +135,7 @@ public _FinalStage accessCodes(List accessCodes) { return this; } - @Override + @java.lang.Override public AccessCodesListResponse build() { return new AccessCodesListResponse(accessCodes, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/AccessCodesPullBackupAccessCodeResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesPullBackupAccessCodeResponse.java similarity index 93% rename from src/main/java/com/seam/api/types/AccessCodesPullBackupAccessCodeResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesPullBackupAccessCodeResponse.java index 1802c4d..3670927 100644 --- a/src/main/java/com/seam/api/types/AccessCodesPullBackupAccessCodeResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesPullBackupAccessCodeResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AccessCode; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesPullBackupAccessCodeResponse @@ -57,12 +58,12 @@ private boolean equalTo(AccessCodesPullBackupAccessCodeResponse other) { return backupAccessCode.equals(other.backupAccessCode) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.backupAccessCode, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +97,28 @@ public static final class Builder implements BackupAccessCodeStage, OkStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesPullBackupAccessCodeResponse other) { backupAccessCode(other.getBackupAccessCode()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("backup_access_code") public OkStage backupAccessCode(AccessCode backupAccessCode) { this.backupAccessCode = backupAccessCode; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public AccessCodesPullBackupAccessCodeResponse build() { return new AccessCodesPullBackupAccessCodeResponse(backupAccessCode, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/AccessCodesUpdateRequestType.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesUpdateRequestType.java similarity index 85% rename from src/main/java/com/seam/api/types/AccessCodesUpdateRequestType.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesUpdateRequestType.java index 0c6e6e5..36ff890 100644 --- a/src/main/java/com/seam/api/types/AccessCodesUpdateRequestType.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesUpdateRequestType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,7 +17,7 @@ public enum AccessCodesUpdateRequestType { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/AccessCodesUpdateResponse.java b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesUpdateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/AccessCodesUpdateResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesUpdateResponse.java index fe4e29d..e2b5472 100644 --- a/src/main/java/com/seam/api/types/AccessCodesUpdateResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/types/AccessCodesUpdateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCodesUpdateResponse && equalTo((AccessCodesUpdateResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(AccessCodesUpdateResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCodesUpdateResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public AccessCodesUpdateResponse build() { return new AccessCodesUpdateResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/UnmanagedClient.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/UnmanagedClient.java index 3bc21c3..afb4aeb 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/UnmanagedClient.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/UnmanagedClient.java @@ -3,27 +3,35 @@ */ package com.seam.api.resources.accesscodes.unmanaged; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.accesscodes.unmanaged.requests.UnmanagedConvertToManagedRequest; import com.seam.api.resources.accesscodes.unmanaged.requests.UnmanagedDeleteRequest; import com.seam.api.resources.accesscodes.unmanaged.requests.UnmanagedGetRequest; import com.seam.api.resources.accesscodes.unmanaged.requests.UnmanagedListRequest; import com.seam.api.resources.accesscodes.unmanaged.requests.UnmanagedUpdateRequest; -import com.seam.api.types.UnmanagedConvertToManagedResponse; -import com.seam.api.types.UnmanagedDeleteResponse; -import com.seam.api.types.UnmanagedGetResponse; -import com.seam.api.types.UnmanagedListResponse; -import com.seam.api.types.UnmanagedUpdateResponse; +import com.seam.api.resources.accesscodes.unmanaged.types.UnmanagedConvertToManagedResponse; +import com.seam.api.resources.accesscodes.unmanaged.types.UnmanagedDeleteResponse; +import com.seam.api.resources.accesscodes.unmanaged.types.UnmanagedGetResponse; +import com.seam.api.resources.accesscodes.unmanaged.types.UnmanagedListResponse; +import com.seam.api.resources.accesscodes.unmanaged.types.UnmanagedUpdateResponse; +import com.seam.api.types.UnmanagedAccessCode; import java.io.IOException; +import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class UnmanagedClient { protected final ClientOptions clientOptions; @@ -32,6 +40,10 @@ public UnmanagedClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + public UnmanagedConvertToManagedResponse convertToManaged(UnmanagedConvertToManagedRequest request) { + return convertToManaged(request, null); + } + public UnmanagedConvertToManagedResponse convertToManaged( UnmanagedConvertToManagedRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -41,9 +53,9 @@ public UnmanagedConvertToManagedResponse convertToManaged( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -51,23 +63,40 @@ public UnmanagedConvertToManagedResponse convertToManaged( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), UnmanagedConvertToManagedResponse.class); + responseBody.string(), UnmanagedConvertToManagedResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public UnmanagedConvertToManagedResponse convertToManaged(UnmanagedConvertToManagedRequest request) { - return convertToManaged(request, null); + public UnmanagedDeleteResponse delete(UnmanagedDeleteRequest request) { + return delete(request, null); } public UnmanagedDeleteResponse delete(UnmanagedDeleteRequest request, RequestOptions requestOptions) { @@ -78,39 +107,56 @@ public UnmanagedDeleteResponse delete(UnmanagedDeleteRequest request, RequestOpt RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("DELETE", body) + .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), UnmanagedDeleteResponse.class); + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UnmanagedDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public UnmanagedDeleteResponse delete(UnmanagedDeleteRequest request) { - return delete(request, null); + public UnmanagedAccessCode get() { + return get(UnmanagedGetRequest.builder().build()); } - public UnmanagedGetResponse get() { - return get(UnmanagedGetRequest.builder().build()); + public UnmanagedAccessCode get(UnmanagedGetRequest request) { + return get(request, null); } - public UnmanagedGetResponse get(UnmanagedGetRequest request, RequestOptions requestOptions) { + public UnmanagedAccessCode get(UnmanagedGetRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("access_codes/unmanaged/get") @@ -118,9 +164,9 @@ public UnmanagedGetResponse get(UnmanagedGetRequest request, RequestOptions requ RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -128,25 +174,44 @@ public UnmanagedGetResponse get(UnmanagedGetRequest request, RequestOptions requ .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), UnmanagedGetResponse.class); + UnmanagedGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UnmanagedGetResponse.class); + return parsedResponse.getAccessCode(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public UnmanagedGetResponse get(UnmanagedGetRequest request) { - return get(request, null); + public List list(UnmanagedListRequest request) { + return list(request, null); } - public UnmanagedListResponse list(UnmanagedListRequest request, RequestOptions requestOptions) { + public List list(UnmanagedListRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("access_codes/unmanaged/list") @@ -154,9 +219,9 @@ public UnmanagedListResponse list(UnmanagedListRequest request, RequestOptions r RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -164,22 +229,41 @@ public UnmanagedListResponse list(UnmanagedListRequest request, RequestOptions r .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), UnmanagedListResponse.class); + UnmanagedListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UnmanagedListResponse.class); + return parsedResponse.getAccessCodes(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public UnmanagedListResponse list(UnmanagedListRequest request) { - return list(request, null); + public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request) { + return update(request, null); } public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request, RequestOptions requestOptions) { @@ -190,9 +274,9 @@ public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request, RequestOpt RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -200,21 +284,34 @@ public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request, RequestOpt .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), UnmanagedUpdateResponse.class); + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UnmanagedUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - - public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request) { - return update(request, null); - } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedConvertToManagedRequest.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedConvertToManagedRequest.java index 97578f2..2f0b0ad 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedConvertToManagedRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedConvertToManagedRequest.java @@ -22,6 +22,10 @@ public final class UnmanagedConvertToManagedRequest { private final String accessCodeId; + private final Optional isExternalModificationAllowed; + + private final Optional allowExternalModification; + private final Optional force; private final Optional sync; @@ -30,10 +34,14 @@ public final class UnmanagedConvertToManagedRequest { private UnmanagedConvertToManagedRequest( String accessCodeId, + Optional isExternalModificationAllowed, + Optional allowExternalModification, Optional force, Optional sync, Map additionalProperties) { this.accessCodeId = accessCodeId; + this.isExternalModificationAllowed = isExternalModificationAllowed; + this.allowExternalModification = allowExternalModification; this.force = force; this.sync = sync; this.additionalProperties = additionalProperties; @@ -44,6 +52,16 @@ public String getAccessCodeId() { return accessCodeId; } + @JsonProperty("is_external_modification_allowed") + public Optional getIsExternalModificationAllowed() { + return isExternalModificationAllowed; + } + + @JsonProperty("allow_external_modification") + public Optional getAllowExternalModification() { + return allowExternalModification; + } + @JsonProperty("force") public Optional getForce() { return force; @@ -54,7 +72,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedConvertToManagedRequest && equalTo((UnmanagedConvertToManagedRequest) other); @@ -66,15 +84,24 @@ public Map getAdditionalProperties() { } private boolean equalTo(UnmanagedConvertToManagedRequest other) { - return accessCodeId.equals(other.accessCodeId) && force.equals(other.force) && sync.equals(other.sync); + return accessCodeId.equals(other.accessCodeId) + && isExternalModificationAllowed.equals(other.isExternalModificationAllowed) + && allowExternalModification.equals(other.allowExternalModification) + && force.equals(other.force) + && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.accessCodeId, this.force, this.sync); + return Objects.hash( + this.accessCodeId, + this.isExternalModificationAllowed, + this.allowExternalModification, + this.force, + this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -92,6 +119,14 @@ public interface AccessCodeIdStage { public interface _FinalStage { UnmanagedConvertToManagedRequest build(); + _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed); + + _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed); + + _FinalStage allowExternalModification(Optional allowExternalModification); + + _FinalStage allowExternalModification(Boolean allowExternalModification); + _FinalStage force(Optional force); _FinalStage force(Boolean force); @@ -109,55 +144,93 @@ public static final class Builder implements AccessCodeIdStage, _FinalStage { private Optional force = Optional.empty(); + private Optional allowExternalModification = Optional.empty(); + + private Optional isExternalModificationAllowed = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedConvertToManagedRequest other) { accessCodeId(other.getAccessCodeId()); + isExternalModificationAllowed(other.getIsExternalModificationAllowed()); + allowExternalModification(other.getAllowExternalModification()); force(other.getForce()); sync(other.getSync()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code_id") public _FinalStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public _FinalStage force(Boolean force) { this.force = Optional.of(force); return this; } - @Override + @java.lang.Override @JsonSetter(value = "force", nulls = Nulls.SKIP) public _FinalStage force(Optional force) { this.force = force; return this; } - @Override + @java.lang.Override + public _FinalStage allowExternalModification(Boolean allowExternalModification) { + this.allowExternalModification = Optional.of(allowExternalModification); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_external_modification", nulls = Nulls.SKIP) + public _FinalStage allowExternalModification(Optional allowExternalModification) { + this.allowExternalModification = allowExternalModification; + return this; + } + + @java.lang.Override + public _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed) { + this.isExternalModificationAllowed = Optional.of(isExternalModificationAllowed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_external_modification_allowed", nulls = Nulls.SKIP) + public _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed) { + this.isExternalModificationAllowed = isExternalModificationAllowed; + return this; + } + + @java.lang.Override public UnmanagedConvertToManagedRequest build() { - return new UnmanagedConvertToManagedRequest(accessCodeId, force, sync, additionalProperties); + return new UnmanagedConvertToManagedRequest( + accessCodeId, + isExternalModificationAllowed, + allowExternalModification, + force, + sync, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedDeleteRequest.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedDeleteRequest.java index 7f9db69..0a0629b 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedDeleteRequest.java @@ -43,7 +43,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedDeleteRequest && equalTo((UnmanagedDeleteRequest) other); @@ -58,12 +58,12 @@ private boolean equalTo(UnmanagedDeleteRequest other) { return accessCodeId.equals(other.accessCodeId) && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessCodeId, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -97,34 +97,34 @@ public static final class Builder implements AccessCodeIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedDeleteRequest other) { accessCodeId(other.getAccessCodeId()); sync(other.getSync()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code_id") public _FinalStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public UnmanagedDeleteRequest build() { return new UnmanagedDeleteRequest(accessCodeId, sync, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedGetRequest.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedGetRequest.java index 3a13f83..336d1bf 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedGetRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedGetRequest.java @@ -54,7 +54,7 @@ public Optional getCode() { return code; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedGetRequest && equalTo((UnmanagedGetRequest) other); @@ -69,12 +69,12 @@ private boolean equalTo(UnmanagedGetRequest other) { return deviceId.equals(other.deviceId) && accessCodeId.equals(other.accessCodeId) && code.equals(other.code); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.accessCodeId, this.code); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedListRequest.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedListRequest.java index 8f92eb0..0b19d62 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedListRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedListRequest.java @@ -9,21 +9,27 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = UnmanagedListRequest.Builder.class) public final class UnmanagedListRequest { private final String deviceId; + private final Optional userIdentifierKey; + private final Map additionalProperties; - private UnmanagedListRequest(String deviceId, Map additionalProperties) { + private UnmanagedListRequest( + String deviceId, Optional userIdentifierKey, Map additionalProperties) { this.deviceId = deviceId; + this.userIdentifierKey = userIdentifierKey; this.additionalProperties = additionalProperties; } @@ -32,7 +38,12 @@ public String getDeviceId() { return deviceId; } - @Override + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedListRequest && equalTo((UnmanagedListRequest) other); @@ -44,15 +55,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(UnmanagedListRequest other) { - return deviceId.equals(other.deviceId); + return deviceId.equals(other.deviceId) && userIdentifierKey.equals(other.userIdentifierKey); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.deviceId); + return Objects.hash(this.deviceId, this.userIdentifierKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -69,33 +80,53 @@ public interface DeviceIdStage { public interface _FinalStage { UnmanagedListRequest build(); + + _FinalStage userIdentifierKey(Optional userIdentifierKey); + + _FinalStage userIdentifierKey(String userIdentifierKey); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceIdStage, _FinalStage { private String deviceId; + private Optional userIdentifierKey = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedListRequest other) { deviceId(other.getDeviceId()); + userIdentifierKey(other.getUserIdentifierKey()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override + public _FinalStage userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public _FinalStage userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + @java.lang.Override public UnmanagedListRequest build() { - return new UnmanagedListRequest(deviceId, additionalProperties); + return new UnmanagedListRequest(deviceId, userIdentifierKey, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedUpdateRequest.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedUpdateRequest.java index bf633ee..10bde7a 100644 --- a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedUpdateRequest.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/requests/UnmanagedUpdateRequest.java @@ -24,14 +24,25 @@ public final class UnmanagedUpdateRequest { private final boolean isManaged; + private final Optional allowExternalModification; + + private final Optional isExternalModificationAllowed; + private final Optional force; private final Map additionalProperties; private UnmanagedUpdateRequest( - String accessCodeId, boolean isManaged, Optional force, Map additionalProperties) { + String accessCodeId, + boolean isManaged, + Optional allowExternalModification, + Optional isExternalModificationAllowed, + Optional force, + Map additionalProperties) { this.accessCodeId = accessCodeId; this.isManaged = isManaged; + this.allowExternalModification = allowExternalModification; + this.isExternalModificationAllowed = isExternalModificationAllowed; this.force = force; this.additionalProperties = additionalProperties; } @@ -46,12 +57,22 @@ public boolean getIsManaged() { return isManaged; } + @JsonProperty("allow_external_modification") + public Optional getAllowExternalModification() { + return allowExternalModification; + } + + @JsonProperty("is_external_modification_allowed") + public Optional getIsExternalModificationAllowed() { + return isExternalModificationAllowed; + } + @JsonProperty("force") public Optional getForce() { return force; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedUpdateRequest && equalTo((UnmanagedUpdateRequest) other); @@ -63,15 +84,24 @@ public Map getAdditionalProperties() { } private boolean equalTo(UnmanagedUpdateRequest other) { - return accessCodeId.equals(other.accessCodeId) && isManaged == other.isManaged && force.equals(other.force); + return accessCodeId.equals(other.accessCodeId) + && isManaged == other.isManaged + && allowExternalModification.equals(other.allowExternalModification) + && isExternalModificationAllowed.equals(other.isExternalModificationAllowed) + && force.equals(other.force); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.accessCodeId, this.isManaged, this.force); + return Objects.hash( + this.accessCodeId, + this.isManaged, + this.allowExternalModification, + this.isExternalModificationAllowed, + this.force); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -93,6 +123,14 @@ public interface IsManagedStage { public interface _FinalStage { UnmanagedUpdateRequest build(); + _FinalStage allowExternalModification(Optional allowExternalModification); + + _FinalStage allowExternalModification(Boolean allowExternalModification); + + _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed); + + _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed); + _FinalStage force(Optional force); _FinalStage force(Boolean force); @@ -106,49 +144,87 @@ public static final class Builder implements AccessCodeIdStage, IsManagedStage, private Optional force = Optional.empty(); + private Optional isExternalModificationAllowed = Optional.empty(); + + private Optional allowExternalModification = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedUpdateRequest other) { accessCodeId(other.getAccessCodeId()); isManaged(other.getIsManaged()); + allowExternalModification(other.getAllowExternalModification()); + isExternalModificationAllowed(other.getIsExternalModificationAllowed()); force(other.getForce()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code_id") public IsManagedStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + @java.lang.Override @JsonSetter("is_managed") public _FinalStage isManaged(boolean isManaged) { this.isManaged = isManaged; return this; } - @Override + @java.lang.Override public _FinalStage force(Boolean force) { this.force = Optional.of(force); return this; } - @Override + @java.lang.Override @JsonSetter(value = "force", nulls = Nulls.SKIP) public _FinalStage force(Optional force) { this.force = force; return this; } - @Override + @java.lang.Override + public _FinalStage isExternalModificationAllowed(Boolean isExternalModificationAllowed) { + this.isExternalModificationAllowed = Optional.of(isExternalModificationAllowed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_external_modification_allowed", nulls = Nulls.SKIP) + public _FinalStage isExternalModificationAllowed(Optional isExternalModificationAllowed) { + this.isExternalModificationAllowed = isExternalModificationAllowed; + return this; + } + + @java.lang.Override + public _FinalStage allowExternalModification(Boolean allowExternalModification) { + this.allowExternalModification = Optional.of(allowExternalModification); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allow_external_modification", nulls = Nulls.SKIP) + public _FinalStage allowExternalModification(Optional allowExternalModification) { + this.allowExternalModification = allowExternalModification; + return this; + } + + @java.lang.Override public UnmanagedUpdateRequest build() { - return new UnmanagedUpdateRequest(accessCodeId, isManaged, force, additionalProperties); + return new UnmanagedUpdateRequest( + accessCodeId, + isManaged, + allowExternalModification, + isExternalModificationAllowed, + force, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/UnmanagedConvertToManagedResponse.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedConvertToManagedResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/UnmanagedConvertToManagedResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedConvertToManagedResponse.java index cbddfc6..0c777e5 100644 --- a/src/main/java/com/seam/api/types/UnmanagedConvertToManagedResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedConvertToManagedResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.unmanaged.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedConvertToManagedResponse && equalTo((UnmanagedConvertToManagedResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(UnmanagedConvertToManagedResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedConvertToManagedResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public UnmanagedConvertToManagedResponse build() { return new UnmanagedConvertToManagedResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/UnmanagedDeleteResponse.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/UnmanagedDeleteResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedDeleteResponse.java index a544027..0848b6f 100644 --- a/src/main/java/com/seam/api/types/UnmanagedDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.unmanaged.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedDeleteResponse && equalTo((UnmanagedDeleteResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(UnmanagedDeleteResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedDeleteResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public UnmanagedDeleteResponse build() { return new UnmanagedDeleteResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/UnmanagedGetResponse.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedGetResponse.java similarity index 80% rename from src/main/java/com/seam/api/types/UnmanagedGetResponse.java rename to src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedGetResponse.java index 21faff8..8fe1b4e 100644 --- a/src/main/java/com/seam/api/types/UnmanagedGetResponse.java +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.accesscodes.unmanaged.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UnmanagedAccessCode; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -18,21 +19,20 @@ @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = UnmanagedGetResponse.Builder.class) public final class UnmanagedGetResponse { - private final UnmanagedGetResponseAccessCode accessCode; + private final UnmanagedAccessCode accessCode; private final boolean ok; private final Map additionalProperties; - private UnmanagedGetResponse( - UnmanagedGetResponseAccessCode accessCode, boolean ok, Map additionalProperties) { + private UnmanagedGetResponse(UnmanagedAccessCode accessCode, boolean ok, Map additionalProperties) { this.accessCode = accessCode; this.ok = ok; this.additionalProperties = additionalProperties; } @JsonProperty("access_code") - public UnmanagedGetResponseAccessCode getAccessCode() { + public UnmanagedAccessCode getAccessCode() { return accessCode; } @@ -41,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedGetResponse && equalTo((UnmanagedGetResponse) other); @@ -56,12 +56,12 @@ private boolean equalTo(UnmanagedGetResponse other) { return accessCode.equals(other.accessCode) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.accessCode, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -71,7 +71,7 @@ public static AccessCodeStage builder() { } public interface AccessCodeStage { - OkStage accessCode(UnmanagedGetResponseAccessCode accessCode); + OkStage accessCode(UnmanagedAccessCode accessCode); Builder from(UnmanagedGetResponse other); } @@ -86,7 +86,7 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements AccessCodeStage, OkStage, _FinalStage { - private UnmanagedGetResponseAccessCode accessCode; + private UnmanagedAccessCode accessCode; private boolean ok; @@ -95,28 +95,28 @@ public static final class Builder implements AccessCodeStage, OkStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedGetResponse other) { accessCode(other.getAccessCode()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("access_code") - public OkStage accessCode(UnmanagedGetResponseAccessCode accessCode) { + public OkStage accessCode(UnmanagedAccessCode accessCode) { this.accessCode = accessCode; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public UnmanagedGetResponse build() { return new UnmanagedGetResponse(accessCode, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedListResponse.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedListResponse.java new file mode 100644 index 0000000..83c0361 --- /dev/null +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedListResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.accesscodes.unmanaged.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UnmanagedAccessCode; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedListResponse.Builder.class) +public final class UnmanagedListResponse { + private final List accessCodes; + + private final boolean ok; + + private final Map additionalProperties; + + private UnmanagedListResponse( + List accessCodes, boolean ok, Map additionalProperties) { + this.accessCodes = accessCodes; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("access_codes") + public List getAccessCodes() { + return accessCodes; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedListResponse && equalTo((UnmanagedListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedListResponse other) { + return accessCodes.equals(other.accessCodes) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accessCodes, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UnmanagedListResponse other); + } + + public interface _FinalStage { + UnmanagedListResponse build(); + + _FinalStage accessCodes(List accessCodes); + + _FinalStage addAccessCodes(UnmanagedAccessCode accessCodes); + + _FinalStage addAllAccessCodes(List accessCodes); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List accessCodes = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UnmanagedListResponse other) { + accessCodes(other.getAccessCodes()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAccessCodes(List accessCodes) { + this.accessCodes.addAll(accessCodes); + return this; + } + + @java.lang.Override + public _FinalStage addAccessCodes(UnmanagedAccessCode accessCodes) { + this.accessCodes.add(accessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "access_codes", nulls = Nulls.SKIP) + public _FinalStage accessCodes(List accessCodes) { + this.accessCodes.clear(); + this.accessCodes.addAll(accessCodes); + return this; + } + + @java.lang.Override + public UnmanagedListResponse build() { + return new UnmanagedListResponse(accessCodes, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedUpdateResponse.java b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedUpdateResponse.java new file mode 100644 index 0000000..09f9bf2 --- /dev/null +++ b/src/main/java/com/seam/api/resources/accesscodes/unmanaged/types/UnmanagedUpdateResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.accesscodes.unmanaged.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedUpdateResponse.Builder.class) +public final class UnmanagedUpdateResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UnmanagedUpdateResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedUpdateResponse && equalTo((UnmanagedUpdateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedUpdateResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UnmanagedUpdateResponse other); + } + + public interface _FinalStage { + UnmanagedUpdateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UnmanagedUpdateResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UnmanagedUpdateResponse build() { + return new UnmanagedUpdateResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/AcsClient.java b/src/main/java/com/seam/api/resources/acs/AcsClient.java new file mode 100644 index 0000000..88b4b32 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/AcsClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs; + +import com.seam.api.core.ClientOptions; +import com.seam.api.core.Suppliers; +import com.seam.api.resources.acs.accessgroups.AccessGroupsClient; +import com.seam.api.resources.acs.credentialpools.CredentialPoolsClient; +import com.seam.api.resources.acs.credentialprovisioningautomations.CredentialProvisioningAutomationsClient; +import com.seam.api.resources.acs.credentials.CredentialsClient; +import com.seam.api.resources.acs.entrances.EntrancesClient; +import com.seam.api.resources.acs.systems.SystemsClient; +import com.seam.api.resources.acs.users.UsersClient; +import java.util.function.Supplier; + +public class AcsClient { + protected final ClientOptions clientOptions; + + protected final Supplier accessGroupsClient; + + protected final Supplier credentialPoolsClient; + + protected final Supplier credentialProvisioningAutomationsClient; + + protected final Supplier credentialsClient; + + protected final Supplier entrancesClient; + + protected final Supplier systemsClient; + + protected final Supplier usersClient; + + public AcsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accessGroupsClient = Suppliers.memoize(() -> new AccessGroupsClient(clientOptions)); + this.credentialPoolsClient = Suppliers.memoize(() -> new CredentialPoolsClient(clientOptions)); + this.credentialProvisioningAutomationsClient = + Suppliers.memoize(() -> new CredentialProvisioningAutomationsClient(clientOptions)); + this.credentialsClient = Suppliers.memoize(() -> new CredentialsClient(clientOptions)); + this.entrancesClient = Suppliers.memoize(() -> new EntrancesClient(clientOptions)); + this.systemsClient = Suppliers.memoize(() -> new SystemsClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); + } + + public AccessGroupsClient accessGroups() { + return this.accessGroupsClient.get(); + } + + public CredentialPoolsClient credentialPools() { + return this.credentialPoolsClient.get(); + } + + public CredentialProvisioningAutomationsClient credentialProvisioningAutomations() { + return this.credentialProvisioningAutomationsClient.get(); + } + + public CredentialsClient credentials() { + return this.credentialsClient.get(); + } + + public EntrancesClient entrances() { + return this.entrancesClient.get(); + } + + public SystemsClient systems() { + return this.systemsClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/AccessGroupsClient.java b/src/main/java/com/seam/api/resources/acs/accessgroups/AccessGroupsClient.java new file mode 100644 index 0000000..2bb3a93 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/AccessGroupsClient.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.acs.accessgroups.requests.AccessGroupsAddUserRequest; +import com.seam.api.resources.acs.accessgroups.requests.AccessGroupsGetRequest; +import com.seam.api.resources.acs.accessgroups.requests.AccessGroupsListRequest; +import com.seam.api.resources.acs.accessgroups.requests.AccessGroupsListUsersRequest; +import com.seam.api.resources.acs.accessgroups.requests.AccessGroupsRemoveUserRequest; +import com.seam.api.resources.acs.accessgroups.types.AccessGroupsAddUserResponse; +import com.seam.api.resources.acs.accessgroups.types.AccessGroupsGetResponse; +import com.seam.api.resources.acs.accessgroups.types.AccessGroupsListResponse; +import com.seam.api.resources.acs.accessgroups.types.AccessGroupsListUsersResponse; +import com.seam.api.resources.acs.accessgroups.types.AccessGroupsRemoveUserResponse; +import com.seam.api.types.AcsAccessGroup; +import com.seam.api.types.AcsUser; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class AccessGroupsClient { + protected final ClientOptions clientOptions; + + public AccessGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public AccessGroupsAddUserResponse addUser(AccessGroupsAddUserRequest request) { + return addUser(request, null); + } + + public AccessGroupsAddUserResponse addUser(AccessGroupsAddUserRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/access_groups/add_user") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessGroupsAddUserResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public AcsAccessGroup get(AccessGroupsGetRequest request) { + return get(request, null); + } + + public AcsAccessGroup get(AccessGroupsGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/access_groups/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + AccessGroupsGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessGroupsGetResponse.class); + return parsedResponse.getAcsAccessGroup(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(AccessGroupsListRequest.builder().build()); + } + + public List list(AccessGroupsListRequest request) { + return list(request, null); + } + + public List list(AccessGroupsListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/access_groups/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + AccessGroupsListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessGroupsListResponse.class); + return parsedResponse.getAcsAccessGroups(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listUsers(AccessGroupsListUsersRequest request) { + return listUsers(request, null); + } + + public List listUsers(AccessGroupsListUsersRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/access_groups/list_users") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + AccessGroupsListUsersResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessGroupsListUsersResponse.class); + return parsedResponse.getAcsUsers(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public AccessGroupsRemoveUserResponse removeUser(AccessGroupsRemoveUserRequest request) { + return removeUser(request, null); + } + + public AccessGroupsRemoveUserResponse removeUser( + AccessGroupsRemoveUserRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/access_groups/remove_user") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccessGroupsRemoveUserResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsAddUserRequest.java b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsAddUserRequest.java new file mode 100644 index 0000000..9696fef --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsAddUserRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsAddUserRequest.Builder.class) +public final class AccessGroupsAddUserRequest { + private final String acsAccessGroupId; + + private final String acsUserId; + + private final Map additionalProperties; + + private AccessGroupsAddUserRequest( + String acsAccessGroupId, String acsUserId, Map additionalProperties) { + this.acsAccessGroupId = acsAccessGroupId; + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_access_group_id") + public String getAcsAccessGroupId() { + return acsAccessGroupId; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsAddUserRequest && equalTo((AccessGroupsAddUserRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsAddUserRequest other) { + return acsAccessGroupId.equals(other.acsAccessGroupId) && acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsAccessGroupId, this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsAccessGroupIdStage builder() { + return new Builder(); + } + + public interface AcsAccessGroupIdStage { + AcsUserIdStage acsAccessGroupId(String acsAccessGroupId); + + Builder from(AccessGroupsAddUserRequest other); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + } + + public interface _FinalStage { + AccessGroupsAddUserRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsAccessGroupIdStage, AcsUserIdStage, _FinalStage { + private String acsAccessGroupId; + + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsAddUserRequest other) { + acsAccessGroupId(other.getAcsAccessGroupId()); + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group_id") + public AcsUserIdStage acsAccessGroupId(String acsAccessGroupId) { + this.acsAccessGroupId = acsAccessGroupId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public AccessGroupsAddUserRequest build() { + return new AccessGroupsAddUserRequest(acsAccessGroupId, acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsGetRequest.java b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsGetRequest.java new file mode 100644 index 0000000..0d5d891 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsGetRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsGetRequest.Builder.class) +public final class AccessGroupsGetRequest { + private final String acsAccessGroupId; + + private final Map additionalProperties; + + private AccessGroupsGetRequest(String acsAccessGroupId, Map additionalProperties) { + this.acsAccessGroupId = acsAccessGroupId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_access_group_id") + public String getAcsAccessGroupId() { + return acsAccessGroupId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsGetRequest && equalTo((AccessGroupsGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsGetRequest other) { + return acsAccessGroupId.equals(other.acsAccessGroupId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsAccessGroupId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsAccessGroupIdStage builder() { + return new Builder(); + } + + public interface AcsAccessGroupIdStage { + _FinalStage acsAccessGroupId(String acsAccessGroupId); + + Builder from(AccessGroupsGetRequest other); + } + + public interface _FinalStage { + AccessGroupsGetRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsAccessGroupIdStage, _FinalStage { + private String acsAccessGroupId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsGetRequest other) { + acsAccessGroupId(other.getAcsAccessGroupId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group_id") + public _FinalStage acsAccessGroupId(String acsAccessGroupId) { + this.acsAccessGroupId = acsAccessGroupId; + return this; + } + + @java.lang.Override + public AccessGroupsGetRequest build() { + return new AccessGroupsGetRequest(acsAccessGroupId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListRequest.java b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListRequest.java new file mode 100644 index 0000000..a34c5cc --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsListRequest.Builder.class) +public final class AccessGroupsListRequest { + private final Optional acsSystemId; + + private final Optional acsUserId; + + private final Map additionalProperties; + + private AccessGroupsListRequest( + Optional acsSystemId, Optional acsUserId, Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public Optional getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("acs_user_id") + public Optional getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsListRequest && equalTo((AccessGroupsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsListRequest other) { + return acsSystemId.equals(other.acsSystemId) && acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystemId, this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional acsSystemId = Optional.empty(); + + private Optional acsUserId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccessGroupsListRequest other) { + acsSystemId(other.getAcsSystemId()); + acsUserId(other.getAcsUserId()); + return this; + } + + @JsonSetter(value = "acs_system_id", nulls = Nulls.SKIP) + public Builder acsSystemId(Optional acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + public Builder acsSystemId(String acsSystemId) { + this.acsSystemId = Optional.of(acsSystemId); + return this; + } + + @JsonSetter(value = "acs_user_id", nulls = Nulls.SKIP) + public Builder acsUserId(Optional acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + public Builder acsUserId(String acsUserId) { + this.acsUserId = Optional.of(acsUserId); + return this; + } + + public AccessGroupsListRequest build() { + return new AccessGroupsListRequest(acsSystemId, acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListUsersRequest.java b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListUsersRequest.java new file mode 100644 index 0000000..56198bd --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsListUsersRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsListUsersRequest.Builder.class) +public final class AccessGroupsListUsersRequest { + private final String acsAccessGroupId; + + private final Map additionalProperties; + + private AccessGroupsListUsersRequest(String acsAccessGroupId, Map additionalProperties) { + this.acsAccessGroupId = acsAccessGroupId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_access_group_id") + public String getAcsAccessGroupId() { + return acsAccessGroupId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsListUsersRequest && equalTo((AccessGroupsListUsersRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsListUsersRequest other) { + return acsAccessGroupId.equals(other.acsAccessGroupId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsAccessGroupId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsAccessGroupIdStage builder() { + return new Builder(); + } + + public interface AcsAccessGroupIdStage { + _FinalStage acsAccessGroupId(String acsAccessGroupId); + + Builder from(AccessGroupsListUsersRequest other); + } + + public interface _FinalStage { + AccessGroupsListUsersRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsAccessGroupIdStage, _FinalStage { + private String acsAccessGroupId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsListUsersRequest other) { + acsAccessGroupId(other.getAcsAccessGroupId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group_id") + public _FinalStage acsAccessGroupId(String acsAccessGroupId) { + this.acsAccessGroupId = acsAccessGroupId; + return this; + } + + @java.lang.Override + public AccessGroupsListUsersRequest build() { + return new AccessGroupsListUsersRequest(acsAccessGroupId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsRemoveUserRequest.java b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsRemoveUserRequest.java new file mode 100644 index 0000000..7999fda --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/requests/AccessGroupsRemoveUserRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsRemoveUserRequest.Builder.class) +public final class AccessGroupsRemoveUserRequest { + private final String acsAccessGroupId; + + private final String acsUserId; + + private final Map additionalProperties; + + private AccessGroupsRemoveUserRequest( + String acsAccessGroupId, String acsUserId, Map additionalProperties) { + this.acsAccessGroupId = acsAccessGroupId; + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_access_group_id") + public String getAcsAccessGroupId() { + return acsAccessGroupId; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsRemoveUserRequest && equalTo((AccessGroupsRemoveUserRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsRemoveUserRequest other) { + return acsAccessGroupId.equals(other.acsAccessGroupId) && acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsAccessGroupId, this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsAccessGroupIdStage builder() { + return new Builder(); + } + + public interface AcsAccessGroupIdStage { + AcsUserIdStage acsAccessGroupId(String acsAccessGroupId); + + Builder from(AccessGroupsRemoveUserRequest other); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + } + + public interface _FinalStage { + AccessGroupsRemoveUserRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsAccessGroupIdStage, AcsUserIdStage, _FinalStage { + private String acsAccessGroupId; + + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsRemoveUserRequest other) { + acsAccessGroupId(other.getAcsAccessGroupId()); + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group_id") + public AcsUserIdStage acsAccessGroupId(String acsAccessGroupId) { + this.acsAccessGroupId = acsAccessGroupId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public AccessGroupsRemoveUserRequest build() { + return new AccessGroupsRemoveUserRequest(acsAccessGroupId, acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsAddUserResponse.java b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsAddUserResponse.java new file mode 100644 index 0000000..e38322d --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsAddUserResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsAddUserResponse.Builder.class) +public final class AccessGroupsAddUserResponse { + private final boolean ok; + + private final Map additionalProperties; + + private AccessGroupsAddUserResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsAddUserResponse && equalTo((AccessGroupsAddUserResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsAddUserResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(AccessGroupsAddUserResponse other); + } + + public interface _FinalStage { + AccessGroupsAddUserResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsAddUserResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public AccessGroupsAddUserResponse build() { + return new AccessGroupsAddUserResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsGetResponse.java b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsGetResponse.java new file mode 100644 index 0000000..792df7f --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsGetResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsAccessGroup; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsGetResponse.Builder.class) +public final class AccessGroupsGetResponse { + private final AcsAccessGroup acsAccessGroup; + + private final boolean ok; + + private final Map additionalProperties; + + private AccessGroupsGetResponse( + AcsAccessGroup acsAccessGroup, boolean ok, Map additionalProperties) { + this.acsAccessGroup = acsAccessGroup; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_access_group") + public AcsAccessGroup getAcsAccessGroup() { + return acsAccessGroup; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsGetResponse && equalTo((AccessGroupsGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsGetResponse other) { + return acsAccessGroup.equals(other.acsAccessGroup) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsAccessGroup, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsAccessGroupStage builder() { + return new Builder(); + } + + public interface AcsAccessGroupStage { + OkStage acsAccessGroup(AcsAccessGroup acsAccessGroup); + + Builder from(AccessGroupsGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + AccessGroupsGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsAccessGroupStage, OkStage, _FinalStage { + private AcsAccessGroup acsAccessGroup; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsGetResponse other) { + acsAccessGroup(other.getAcsAccessGroup()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group") + public OkStage acsAccessGroup(AcsAccessGroup acsAccessGroup) { + this.acsAccessGroup = acsAccessGroup; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public AccessGroupsGetResponse build() { + return new AccessGroupsGetResponse(acsAccessGroup, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListResponse.java b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListResponse.java new file mode 100644 index 0000000..d3c6ce5 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsAccessGroup; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsListResponse.Builder.class) +public final class AccessGroupsListResponse { + private final List acsAccessGroups; + + private final boolean ok; + + private final Map additionalProperties; + + private AccessGroupsListResponse( + List acsAccessGroups, boolean ok, Map additionalProperties) { + this.acsAccessGroups = acsAccessGroups; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_access_groups") + public List getAcsAccessGroups() { + return acsAccessGroups; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsListResponse && equalTo((AccessGroupsListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsListResponse other) { + return acsAccessGroups.equals(other.acsAccessGroups) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsAccessGroups, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(AccessGroupsListResponse other); + } + + public interface _FinalStage { + AccessGroupsListResponse build(); + + _FinalStage acsAccessGroups(List acsAccessGroups); + + _FinalStage addAcsAccessGroups(AcsAccessGroup acsAccessGroups); + + _FinalStage addAllAcsAccessGroups(List acsAccessGroups); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsAccessGroups = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsListResponse other) { + acsAccessGroups(other.getAcsAccessGroups()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsAccessGroups(List acsAccessGroups) { + this.acsAccessGroups.addAll(acsAccessGroups); + return this; + } + + @java.lang.Override + public _FinalStage addAcsAccessGroups(AcsAccessGroup acsAccessGroups) { + this.acsAccessGroups.add(acsAccessGroups); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_access_groups", nulls = Nulls.SKIP) + public _FinalStage acsAccessGroups(List acsAccessGroups) { + this.acsAccessGroups.clear(); + this.acsAccessGroups.addAll(acsAccessGroups); + return this; + } + + @java.lang.Override + public AccessGroupsListResponse build() { + return new AccessGroupsListResponse(acsAccessGroups, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListUsersResponse.java b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListUsersResponse.java new file mode 100644 index 0000000..a74c7ad --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsListUsersResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsUser; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsListUsersResponse.Builder.class) +public final class AccessGroupsListUsersResponse { + private final List acsUsers; + + private final boolean ok; + + private final Map additionalProperties; + + private AccessGroupsListUsersResponse( + List acsUsers, boolean ok, Map additionalProperties) { + this.acsUsers = acsUsers; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_users") + public List getAcsUsers() { + return acsUsers; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsListUsersResponse && equalTo((AccessGroupsListUsersResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsListUsersResponse other) { + return acsUsers.equals(other.acsUsers) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUsers, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(AccessGroupsListUsersResponse other); + } + + public interface _FinalStage { + AccessGroupsListUsersResponse build(); + + _FinalStage acsUsers(List acsUsers); + + _FinalStage addAcsUsers(AcsUser acsUsers); + + _FinalStage addAllAcsUsers(List acsUsers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsUsers = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsListUsersResponse other) { + acsUsers(other.getAcsUsers()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsUsers(List acsUsers) { + this.acsUsers.addAll(acsUsers); + return this; + } + + @java.lang.Override + public _FinalStage addAcsUsers(AcsUser acsUsers) { + this.acsUsers.add(acsUsers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_users", nulls = Nulls.SKIP) + public _FinalStage acsUsers(List acsUsers) { + this.acsUsers.clear(); + this.acsUsers.addAll(acsUsers); + return this; + } + + @java.lang.Override + public AccessGroupsListUsersResponse build() { + return new AccessGroupsListUsersResponse(acsUsers, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsRemoveUserResponse.java b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsRemoveUserResponse.java new file mode 100644 index 0000000..3a45411 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/accessgroups/types/AccessGroupsRemoveUserResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.accessgroups.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AccessGroupsRemoveUserResponse.Builder.class) +public final class AccessGroupsRemoveUserResponse { + private final boolean ok; + + private final Map additionalProperties; + + private AccessGroupsRemoveUserResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccessGroupsRemoveUserResponse && equalTo((AccessGroupsRemoveUserResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccessGroupsRemoveUserResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(AccessGroupsRemoveUserResponse other); + } + + public interface _FinalStage { + AccessGroupsRemoveUserResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccessGroupsRemoveUserResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public AccessGroupsRemoveUserResponse build() { + return new AccessGroupsRemoveUserResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentialpools/CredentialPoolsClient.java b/src/main/java/com/seam/api/resources/acs/credentialpools/CredentialPoolsClient.java new file mode 100644 index 0000000..2d35ad8 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentialpools/CredentialPoolsClient.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentialpools; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.acs.credentialpools.requests.CredentialPoolsListRequest; +import com.seam.api.resources.acs.credentialpools.types.CredentialPoolsListResponse; +import com.seam.api.types.AcsCredentialPool; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class CredentialPoolsClient { + protected final ClientOptions clientOptions; + + public CredentialPoolsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public List list(CredentialPoolsListRequest request) { + return list(request, null); + } + + public List list(CredentialPoolsListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credential_pools/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + CredentialPoolsListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialPoolsListResponse.class); + return parsedResponse.getAcsCredentialPools(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentialpools/requests/CredentialPoolsListRequest.java b/src/main/java/com/seam/api/resources/acs/credentialpools/requests/CredentialPoolsListRequest.java new file mode 100644 index 0000000..54b1f8c --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentialpools/requests/CredentialPoolsListRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentialpools.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialPoolsListRequest.Builder.class) +public final class CredentialPoolsListRequest { + private final String acsSystemId; + + private final Map additionalProperties; + + private CredentialPoolsListRequest(String acsSystemId, Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialPoolsListRequest && equalTo((CredentialPoolsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialPoolsListRequest other) { + return acsSystemId.equals(other.acsSystemId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystemId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsSystemIdStage builder() { + return new Builder(); + } + + public interface AcsSystemIdStage { + _FinalStage acsSystemId(String acsSystemId); + + Builder from(CredentialPoolsListRequest other); + } + + public interface _FinalStage { + CredentialPoolsListRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsSystemIdStage, _FinalStage { + private String acsSystemId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialPoolsListRequest other) { + acsSystemId(other.getAcsSystemId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public _FinalStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + public CredentialPoolsListRequest build() { + return new CredentialPoolsListRequest(acsSystemId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentialpools/types/CredentialPoolsListResponse.java b/src/main/java/com/seam/api/resources/acs/credentialpools/types/CredentialPoolsListResponse.java new file mode 100644 index 0000000..bb0e7a0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentialpools/types/CredentialPoolsListResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentialpools.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredentialPool; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialPoolsListResponse.Builder.class) +public final class CredentialPoolsListResponse { + private final List acsCredentialPools; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialPoolsListResponse( + List acsCredentialPools, boolean ok, Map additionalProperties) { + this.acsCredentialPools = acsCredentialPools; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_pools") + public List getAcsCredentialPools() { + return acsCredentialPools; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialPoolsListResponse && equalTo((CredentialPoolsListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialPoolsListResponse other) { + return acsCredentialPools.equals(other.acsCredentialPools) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentialPools, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(CredentialPoolsListResponse other); + } + + public interface _FinalStage { + CredentialPoolsListResponse build(); + + _FinalStage acsCredentialPools(List acsCredentialPools); + + _FinalStage addAcsCredentialPools(AcsCredentialPool acsCredentialPools); + + _FinalStage addAllAcsCredentialPools(List acsCredentialPools); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsCredentialPools = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialPoolsListResponse other) { + acsCredentialPools(other.getAcsCredentialPools()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsCredentialPools(List acsCredentialPools) { + this.acsCredentialPools.addAll(acsCredentialPools); + return this; + } + + @java.lang.Override + public _FinalStage addAcsCredentialPools(AcsCredentialPool acsCredentialPools) { + this.acsCredentialPools.add(acsCredentialPools); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_credential_pools", nulls = Nulls.SKIP) + public _FinalStage acsCredentialPools(List acsCredentialPools) { + this.acsCredentialPools.clear(); + this.acsCredentialPools.addAll(acsCredentialPools); + return this; + } + + @java.lang.Override + public CredentialPoolsListResponse build() { + return new CredentialPoolsListResponse(acsCredentialPools, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/CredentialProvisioningAutomationsClient.java b/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/CredentialProvisioningAutomationsClient.java new file mode 100644 index 0000000..b67c7d4 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/CredentialProvisioningAutomationsClient.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentialprovisioningautomations; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.acs.credentialprovisioningautomations.requests.CredentialProvisioningAutomationsLaunchRequest; +import com.seam.api.resources.acs.credentialprovisioningautomations.types.CredentialProvisioningAutomationsLaunchResponse; +import com.seam.api.types.AcsCredentialProvisioningAutomation; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class CredentialProvisioningAutomationsClient { + protected final ClientOptions clientOptions; + + public CredentialProvisioningAutomationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public AcsCredentialProvisioningAutomation launch(CredentialProvisioningAutomationsLaunchRequest request) { + return launch(request, null); + } + + public AcsCredentialProvisioningAutomation launch( + CredentialProvisioningAutomationsLaunchRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credential_provisioning_automations/launch") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + CredentialProvisioningAutomationsLaunchResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), CredentialProvisioningAutomationsLaunchResponse.class); + return parsedResponse.getAcsCredentialProvisioningAutomation(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/requests/CredentialProvisioningAutomationsLaunchRequest.java b/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/requests/CredentialProvisioningAutomationsLaunchRequest.java new file mode 100644 index 0000000..4751382 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/requests/CredentialProvisioningAutomationsLaunchRequest.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentialprovisioningautomations.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialProvisioningAutomationsLaunchRequest.Builder.class) +public final class CredentialProvisioningAutomationsLaunchRequest { + private final String userIdentityId; + + private final String credentialManagerAcsSystemId; + + private final Optional acsCredentialPoolId; + + private final Optional createCredentialManagerUser; + + private final Optional credentialManagerAcsUserId; + + private final Map additionalProperties; + + private CredentialProvisioningAutomationsLaunchRequest( + String userIdentityId, + String credentialManagerAcsSystemId, + Optional acsCredentialPoolId, + Optional createCredentialManagerUser, + Optional credentialManagerAcsUserId, + Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + this.acsCredentialPoolId = acsCredentialPoolId; + this.createCredentialManagerUser = createCredentialManagerUser; + this.credentialManagerAcsUserId = credentialManagerAcsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("credential_manager_acs_system_id") + public String getCredentialManagerAcsSystemId() { + return credentialManagerAcsSystemId; + } + + @JsonProperty("acs_credential_pool_id") + public Optional getAcsCredentialPoolId() { + return acsCredentialPoolId; + } + + @JsonProperty("create_credential_manager_user") + public Optional getCreateCredentialManagerUser() { + return createCredentialManagerUser; + } + + @JsonProperty("credential_manager_acs_user_id") + public Optional getCredentialManagerAcsUserId() { + return credentialManagerAcsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialProvisioningAutomationsLaunchRequest + && equalTo((CredentialProvisioningAutomationsLaunchRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialProvisioningAutomationsLaunchRequest other) { + return userIdentityId.equals(other.userIdentityId) + && credentialManagerAcsSystemId.equals(other.credentialManagerAcsSystemId) + && acsCredentialPoolId.equals(other.acsCredentialPoolId) + && createCredentialManagerUser.equals(other.createCredentialManagerUser) + && credentialManagerAcsUserId.equals(other.credentialManagerAcsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userIdentityId, + this.credentialManagerAcsSystemId, + this.acsCredentialPoolId, + this.createCredentialManagerUser, + this.credentialManagerAcsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + CredentialManagerAcsSystemIdStage userIdentityId(String userIdentityId); + + Builder from(CredentialProvisioningAutomationsLaunchRequest other); + } + + public interface CredentialManagerAcsSystemIdStage { + _FinalStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId); + } + + public interface _FinalStage { + CredentialProvisioningAutomationsLaunchRequest build(); + + _FinalStage acsCredentialPoolId(Optional acsCredentialPoolId); + + _FinalStage acsCredentialPoolId(String acsCredentialPoolId); + + _FinalStage createCredentialManagerUser(Optional createCredentialManagerUser); + + _FinalStage createCredentialManagerUser(Boolean createCredentialManagerUser); + + _FinalStage credentialManagerAcsUserId(Optional credentialManagerAcsUserId); + + _FinalStage credentialManagerAcsUserId(String credentialManagerAcsUserId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, CredentialManagerAcsSystemIdStage, _FinalStage { + private String userIdentityId; + + private String credentialManagerAcsSystemId; + + private Optional credentialManagerAcsUserId = Optional.empty(); + + private Optional createCredentialManagerUser = Optional.empty(); + + private Optional acsCredentialPoolId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialProvisioningAutomationsLaunchRequest other) { + userIdentityId(other.getUserIdentityId()); + credentialManagerAcsSystemId(other.getCredentialManagerAcsSystemId()); + acsCredentialPoolId(other.getAcsCredentialPoolId()); + createCredentialManagerUser(other.getCreateCredentialManagerUser()); + credentialManagerAcsUserId(other.getCredentialManagerAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public CredentialManagerAcsSystemIdStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("credential_manager_acs_system_id") + public _FinalStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + return this; + } + + @java.lang.Override + public _FinalStage credentialManagerAcsUserId(String credentialManagerAcsUserId) { + this.credentialManagerAcsUserId = Optional.of(credentialManagerAcsUserId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "credential_manager_acs_user_id", nulls = Nulls.SKIP) + public _FinalStage credentialManagerAcsUserId(Optional credentialManagerAcsUserId) { + this.credentialManagerAcsUserId = credentialManagerAcsUserId; + return this; + } + + @java.lang.Override + public _FinalStage createCredentialManagerUser(Boolean createCredentialManagerUser) { + this.createCredentialManagerUser = Optional.of(createCredentialManagerUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "create_credential_manager_user", nulls = Nulls.SKIP) + public _FinalStage createCredentialManagerUser(Optional createCredentialManagerUser) { + this.createCredentialManagerUser = createCredentialManagerUser; + return this; + } + + @java.lang.Override + public _FinalStage acsCredentialPoolId(String acsCredentialPoolId) { + this.acsCredentialPoolId = Optional.of(acsCredentialPoolId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_credential_pool_id", nulls = Nulls.SKIP) + public _FinalStage acsCredentialPoolId(Optional acsCredentialPoolId) { + this.acsCredentialPoolId = acsCredentialPoolId; + return this; + } + + @java.lang.Override + public CredentialProvisioningAutomationsLaunchRequest build() { + return new CredentialProvisioningAutomationsLaunchRequest( + userIdentityId, + credentialManagerAcsSystemId, + acsCredentialPoolId, + createCredentialManagerUser, + credentialManagerAcsUserId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/types/CredentialProvisioningAutomationsLaunchResponse.java b/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/types/CredentialProvisioningAutomationsLaunchResponse.java new file mode 100644 index 0000000..ec22def --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentialprovisioningautomations/types/CredentialProvisioningAutomationsLaunchResponse.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentialprovisioningautomations.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredentialProvisioningAutomation; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialProvisioningAutomationsLaunchResponse.Builder.class) +public final class CredentialProvisioningAutomationsLaunchResponse { + private final AcsCredentialProvisioningAutomation acsCredentialProvisioningAutomation; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialProvisioningAutomationsLaunchResponse( + AcsCredentialProvisioningAutomation acsCredentialProvisioningAutomation, + boolean ok, + Map additionalProperties) { + this.acsCredentialProvisioningAutomation = acsCredentialProvisioningAutomation; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_provisioning_automation") + public AcsCredentialProvisioningAutomation getAcsCredentialProvisioningAutomation() { + return acsCredentialProvisioningAutomation; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialProvisioningAutomationsLaunchResponse + && equalTo((CredentialProvisioningAutomationsLaunchResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialProvisioningAutomationsLaunchResponse other) { + return acsCredentialProvisioningAutomation.equals(other.acsCredentialProvisioningAutomation) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentialProvisioningAutomation, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialProvisioningAutomationStage builder() { + return new Builder(); + } + + public interface AcsCredentialProvisioningAutomationStage { + OkStage acsCredentialProvisioningAutomation( + AcsCredentialProvisioningAutomation acsCredentialProvisioningAutomation); + + Builder from(CredentialProvisioningAutomationsLaunchResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + CredentialProvisioningAutomationsLaunchResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialProvisioningAutomationStage, OkStage, _FinalStage { + private AcsCredentialProvisioningAutomation acsCredentialProvisioningAutomation; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialProvisioningAutomationsLaunchResponse other) { + acsCredentialProvisioningAutomation(other.getAcsCredentialProvisioningAutomation()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_provisioning_automation") + public OkStage acsCredentialProvisioningAutomation( + AcsCredentialProvisioningAutomation acsCredentialProvisioningAutomation) { + this.acsCredentialProvisioningAutomation = acsCredentialProvisioningAutomation; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public CredentialProvisioningAutomationsLaunchResponse build() { + return new CredentialProvisioningAutomationsLaunchResponse( + acsCredentialProvisioningAutomation, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/CredentialsClient.java b/src/main/java/com/seam/api/resources/acs/credentials/CredentialsClient.java new file mode 100644 index 0000000..6963b27 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/CredentialsClient.java @@ -0,0 +1,486 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.acs.credentials.requests.CredentialsAssignRequest; +import com.seam.api.resources.acs.credentials.requests.CredentialsCreateRequest; +import com.seam.api.resources.acs.credentials.requests.CredentialsDeleteRequest; +import com.seam.api.resources.acs.credentials.requests.CredentialsGetRequest; +import com.seam.api.resources.acs.credentials.requests.CredentialsListAccessibleEntrancesRequest; +import com.seam.api.resources.acs.credentials.requests.CredentialsListRequest; +import com.seam.api.resources.acs.credentials.requests.CredentialsUnassignRequest; +import com.seam.api.resources.acs.credentials.requests.CredentialsUpdateRequest; +import com.seam.api.resources.acs.credentials.types.CredentialsAssignResponse; +import com.seam.api.resources.acs.credentials.types.CredentialsCreateResponse; +import com.seam.api.resources.acs.credentials.types.CredentialsDeleteResponse; +import com.seam.api.resources.acs.credentials.types.CredentialsGetResponse; +import com.seam.api.resources.acs.credentials.types.CredentialsListAccessibleEntrancesResponse; +import com.seam.api.resources.acs.credentials.types.CredentialsListResponse; +import com.seam.api.resources.acs.credentials.types.CredentialsUnassignResponse; +import com.seam.api.resources.acs.credentials.types.CredentialsUpdateResponse; +import com.seam.api.types.AcsCredential; +import com.seam.api.types.AcsEntrance; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class CredentialsClient { + protected final ClientOptions clientOptions; + + public CredentialsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CredentialsAssignResponse assign(CredentialsAssignRequest request) { + return assign(request, null); + } + + public CredentialsAssignResponse assign(CredentialsAssignRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/assign") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialsAssignResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public AcsCredential create(CredentialsCreateRequest request) { + return create(request, null); + } + + public AcsCredential create(CredentialsCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/create") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + CredentialsCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialsCreateResponse.class); + return parsedResponse.getAcsCredential(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public CredentialsDeleteResponse delete(CredentialsDeleteRequest request) { + return delete(request, null); + } + + public CredentialsDeleteResponse delete(CredentialsDeleteRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/delete") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialsDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public AcsCredential get(CredentialsGetRequest request) { + return get(request, null); + } + + public AcsCredential get(CredentialsGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + CredentialsGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialsGetResponse.class); + return parsedResponse.getAcsCredential(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(CredentialsListRequest.builder().build()); + } + + public List list(CredentialsListRequest request) { + return list(request, null); + } + + public List list(CredentialsListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + CredentialsListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialsListResponse.class); + return parsedResponse.getAcsCredentials(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listAccessibleEntrances(CredentialsListAccessibleEntrancesRequest request) { + return listAccessibleEntrances(request, null); + } + + public List listAccessibleEntrances( + CredentialsListAccessibleEntrancesRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/list_accessible_entrances") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + CredentialsListAccessibleEntrancesResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), CredentialsListAccessibleEntrancesResponse.class); + return parsedResponse.getAcsEntrances(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public CredentialsUnassignResponse unassign(CredentialsUnassignRequest request) { + return unassign(request, null); + } + + public CredentialsUnassignResponse unassign(CredentialsUnassignRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/unassign") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialsUnassignResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public CredentialsUpdateResponse update(CredentialsUpdateRequest request) { + return update(request, null); + } + + public CredentialsUpdateResponse update(CredentialsUpdateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/credentials/update") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CredentialsUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsAssignRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsAssignRequest.java new file mode 100644 index 0000000..db05f48 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsAssignRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsAssignRequest.Builder.class) +public final class CredentialsAssignRequest { + private final String acsUserId; + + private final String acsCredentialId; + + private final Map additionalProperties; + + private CredentialsAssignRequest( + String acsUserId, String acsCredentialId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.acsCredentialId = acsCredentialId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_credential_id") + public String getAcsCredentialId() { + return acsCredentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsAssignRequest && equalTo((CredentialsAssignRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsAssignRequest other) { + return acsUserId.equals(other.acsUserId) && acsCredentialId.equals(other.acsCredentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId, this.acsCredentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + AcsCredentialIdStage acsUserId(String acsUserId); + + Builder from(CredentialsAssignRequest other); + } + + public interface AcsCredentialIdStage { + _FinalStage acsCredentialId(String acsCredentialId); + } + + public interface _FinalStage { + CredentialsAssignRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, AcsCredentialIdStage, _FinalStage { + private String acsUserId; + + private String acsCredentialId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsAssignRequest other) { + acsUserId(other.getAcsUserId()); + acsCredentialId(other.getAcsCredentialId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public AcsCredentialIdStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_id") + public _FinalStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + public CredentialsAssignRequest build() { + return new CredentialsAssignRequest(acsUserId, acsCredentialId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsCreateRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsCreateRequest.java new file mode 100644 index 0000000..cd434f6 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsCreateRequest.java @@ -0,0 +1,362 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.acs.credentials.types.CredentialsCreateRequestAccessMethod; +import com.seam.api.resources.acs.credentials.types.CredentialsCreateRequestVisionlineMetadata; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsCreateRequest.Builder.class) +public final class CredentialsCreateRequest { + private final Optional credentialManagerAcsSystemId; + + private final String acsUserId; + + private final CredentialsCreateRequestAccessMethod accessMethod; + + private final Optional code; + + private final Optional isMultiPhoneSyncCredential; + + private final Optional> allowedAcsEntranceIds; + + private final Optional visionlineMetadata; + + private final Optional startsAt; + + private final Optional endsAt; + + private final Map additionalProperties; + + private CredentialsCreateRequest( + Optional credentialManagerAcsSystemId, + String acsUserId, + CredentialsCreateRequestAccessMethod accessMethod, + Optional code, + Optional isMultiPhoneSyncCredential, + Optional> allowedAcsEntranceIds, + Optional visionlineMetadata, + Optional startsAt, + Optional endsAt, + Map additionalProperties) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + this.acsUserId = acsUserId; + this.accessMethod = accessMethod; + this.code = code; + this.isMultiPhoneSyncCredential = isMultiPhoneSyncCredential; + this.allowedAcsEntranceIds = allowedAcsEntranceIds; + this.visionlineMetadata = visionlineMetadata; + this.startsAt = startsAt; + this.endsAt = endsAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("credential_manager_acs_system_id") + public Optional getCredentialManagerAcsSystemId() { + return credentialManagerAcsSystemId; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @JsonProperty("access_method") + public CredentialsCreateRequestAccessMethod getAccessMethod() { + return accessMethod; + } + + @JsonProperty("code") + public Optional getCode() { + return code; + } + + @JsonProperty("is_multi_phone_sync_credential") + public Optional getIsMultiPhoneSyncCredential() { + return isMultiPhoneSyncCredential; + } + + @JsonProperty("allowed_acs_entrance_ids") + public Optional> getAllowedAcsEntranceIds() { + return allowedAcsEntranceIds; + } + + @JsonProperty("visionline_metadata") + public Optional getVisionlineMetadata() { + return visionlineMetadata; + } + + @JsonProperty("starts_at") + public Optional getStartsAt() { + return startsAt; + } + + @JsonProperty("ends_at") + public Optional getEndsAt() { + return endsAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsCreateRequest && equalTo((CredentialsCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsCreateRequest other) { + return credentialManagerAcsSystemId.equals(other.credentialManagerAcsSystemId) + && acsUserId.equals(other.acsUserId) + && accessMethod.equals(other.accessMethod) + && code.equals(other.code) + && isMultiPhoneSyncCredential.equals(other.isMultiPhoneSyncCredential) + && allowedAcsEntranceIds.equals(other.allowedAcsEntranceIds) + && visionlineMetadata.equals(other.visionlineMetadata) + && startsAt.equals(other.startsAt) + && endsAt.equals(other.endsAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.credentialManagerAcsSystemId, + this.acsUserId, + this.accessMethod, + this.code, + this.isMultiPhoneSyncCredential, + this.allowedAcsEntranceIds, + this.visionlineMetadata, + this.startsAt, + this.endsAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + AccessMethodStage acsUserId(String acsUserId); + + Builder from(CredentialsCreateRequest other); + } + + public interface AccessMethodStage { + _FinalStage accessMethod(CredentialsCreateRequestAccessMethod accessMethod); + } + + public interface _FinalStage { + CredentialsCreateRequest build(); + + _FinalStage credentialManagerAcsSystemId(Optional credentialManagerAcsSystemId); + + _FinalStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId); + + _FinalStage code(Optional code); + + _FinalStage code(String code); + + _FinalStage isMultiPhoneSyncCredential(Optional isMultiPhoneSyncCredential); + + _FinalStage isMultiPhoneSyncCredential(Boolean isMultiPhoneSyncCredential); + + _FinalStage allowedAcsEntranceIds(Optional> allowedAcsEntranceIds); + + _FinalStage allowedAcsEntranceIds(List allowedAcsEntranceIds); + + _FinalStage visionlineMetadata(Optional visionlineMetadata); + + _FinalStage visionlineMetadata(CredentialsCreateRequestVisionlineMetadata visionlineMetadata); + + _FinalStage startsAt(Optional startsAt); + + _FinalStage startsAt(OffsetDateTime startsAt); + + _FinalStage endsAt(Optional endsAt); + + _FinalStage endsAt(OffsetDateTime endsAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, AccessMethodStage, _FinalStage { + private String acsUserId; + + private CredentialsCreateRequestAccessMethod accessMethod; + + private Optional endsAt = Optional.empty(); + + private Optional startsAt = Optional.empty(); + + private Optional visionlineMetadata = Optional.empty(); + + private Optional> allowedAcsEntranceIds = Optional.empty(); + + private Optional isMultiPhoneSyncCredential = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional credentialManagerAcsSystemId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsCreateRequest other) { + credentialManagerAcsSystemId(other.getCredentialManagerAcsSystemId()); + acsUserId(other.getAcsUserId()); + accessMethod(other.getAccessMethod()); + code(other.getCode()); + isMultiPhoneSyncCredential(other.getIsMultiPhoneSyncCredential()); + allowedAcsEntranceIds(other.getAllowedAcsEntranceIds()); + visionlineMetadata(other.getVisionlineMetadata()); + startsAt(other.getStartsAt()); + endsAt(other.getEndsAt()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public AccessMethodStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + @JsonSetter("access_method") + public _FinalStage accessMethod(CredentialsCreateRequestAccessMethod accessMethod) { + this.accessMethod = accessMethod; + return this; + } + + @java.lang.Override + public _FinalStage endsAt(OffsetDateTime endsAt) { + this.endsAt = Optional.of(endsAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) + public _FinalStage endsAt(Optional endsAt) { + this.endsAt = endsAt; + return this; + } + + @java.lang.Override + public _FinalStage startsAt(OffsetDateTime startsAt) { + this.startsAt = Optional.of(startsAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) + public _FinalStage startsAt(Optional startsAt) { + this.startsAt = startsAt; + return this; + } + + @java.lang.Override + public _FinalStage visionlineMetadata(CredentialsCreateRequestVisionlineMetadata visionlineMetadata) { + this.visionlineMetadata = Optional.of(visionlineMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "visionline_metadata", nulls = Nulls.SKIP) + public _FinalStage visionlineMetadata(Optional visionlineMetadata) { + this.visionlineMetadata = visionlineMetadata; + return this; + } + + @java.lang.Override + public _FinalStage allowedAcsEntranceIds(List allowedAcsEntranceIds) { + this.allowedAcsEntranceIds = Optional.of(allowedAcsEntranceIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "allowed_acs_entrance_ids", nulls = Nulls.SKIP) + public _FinalStage allowedAcsEntranceIds(Optional> allowedAcsEntranceIds) { + this.allowedAcsEntranceIds = allowedAcsEntranceIds; + return this; + } + + @java.lang.Override + public _FinalStage isMultiPhoneSyncCredential(Boolean isMultiPhoneSyncCredential) { + this.isMultiPhoneSyncCredential = Optional.of(isMultiPhoneSyncCredential); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_multi_phone_sync_credential", nulls = Nulls.SKIP) + public _FinalStage isMultiPhoneSyncCredential(Optional isMultiPhoneSyncCredential) { + this.isMultiPhoneSyncCredential = isMultiPhoneSyncCredential; + return this; + } + + @java.lang.Override + public _FinalStage code(String code) { + this.code = Optional.of(code); + return this; + } + + @java.lang.Override + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public _FinalStage code(Optional code) { + this.code = code; + return this; + } + + @java.lang.Override + public _FinalStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = Optional.of(credentialManagerAcsSystemId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "credential_manager_acs_system_id", nulls = Nulls.SKIP) + public _FinalStage credentialManagerAcsSystemId(Optional credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + return this; + } + + @java.lang.Override + public CredentialsCreateRequest build() { + return new CredentialsCreateRequest( + credentialManagerAcsSystemId, + acsUserId, + accessMethod, + code, + isMultiPhoneSyncCredential, + allowedAcsEntranceIds, + visionlineMetadata, + startsAt, + endsAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsDeleteRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsDeleteRequest.java new file mode 100644 index 0000000..07ec112 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsDeleteRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsDeleteRequest.Builder.class) +public final class CredentialsDeleteRequest { + private final String acsCredentialId; + + private final Map additionalProperties; + + private CredentialsDeleteRequest(String acsCredentialId, Map additionalProperties) { + this.acsCredentialId = acsCredentialId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_id") + public String getAcsCredentialId() { + return acsCredentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsDeleteRequest && equalTo((CredentialsDeleteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsDeleteRequest other) { + return acsCredentialId.equals(other.acsCredentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialIdStage { + _FinalStage acsCredentialId(String acsCredentialId); + + Builder from(CredentialsDeleteRequest other); + } + + public interface _FinalStage { + CredentialsDeleteRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialIdStage, _FinalStage { + private String acsCredentialId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsDeleteRequest other) { + acsCredentialId(other.getAcsCredentialId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_id") + public _FinalStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + public CredentialsDeleteRequest build() { + return new CredentialsDeleteRequest(acsCredentialId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsGetRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsGetRequest.java new file mode 100644 index 0000000..060a5be --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsGetRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsGetRequest.Builder.class) +public final class CredentialsGetRequest { + private final String acsCredentialId; + + private final Map additionalProperties; + + private CredentialsGetRequest(String acsCredentialId, Map additionalProperties) { + this.acsCredentialId = acsCredentialId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_id") + public String getAcsCredentialId() { + return acsCredentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsGetRequest && equalTo((CredentialsGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsGetRequest other) { + return acsCredentialId.equals(other.acsCredentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialIdStage { + _FinalStage acsCredentialId(String acsCredentialId); + + Builder from(CredentialsGetRequest other); + } + + public interface _FinalStage { + CredentialsGetRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialIdStage, _FinalStage { + private String acsCredentialId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsGetRequest other) { + acsCredentialId(other.getAcsCredentialId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_id") + public _FinalStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + public CredentialsGetRequest build() { + return new CredentialsGetRequest(acsCredentialId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListAccessibleEntrancesRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListAccessibleEntrancesRequest.java new file mode 100644 index 0000000..cc5f07c --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListAccessibleEntrancesRequest.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsListAccessibleEntrancesRequest.Builder.class) +public final class CredentialsListAccessibleEntrancesRequest { + private final String acsCredentialId; + + private final Map additionalProperties; + + private CredentialsListAccessibleEntrancesRequest( + String acsCredentialId, Map additionalProperties) { + this.acsCredentialId = acsCredentialId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_id") + public String getAcsCredentialId() { + return acsCredentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsListAccessibleEntrancesRequest + && equalTo((CredentialsListAccessibleEntrancesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsListAccessibleEntrancesRequest other) { + return acsCredentialId.equals(other.acsCredentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialIdStage { + _FinalStage acsCredentialId(String acsCredentialId); + + Builder from(CredentialsListAccessibleEntrancesRequest other); + } + + public interface _FinalStage { + CredentialsListAccessibleEntrancesRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialIdStage, _FinalStage { + private String acsCredentialId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsListAccessibleEntrancesRequest other) { + acsCredentialId(other.getAcsCredentialId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_id") + public _FinalStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + public CredentialsListAccessibleEntrancesRequest build() { + return new CredentialsListAccessibleEntrancesRequest(acsCredentialId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListRequest.java new file mode 100644 index 0000000..cec4822 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsListRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsListRequest.Builder.class) +public final class CredentialsListRequest { + private final Optional acsUserId; + + private final Optional acsSystemId; + + private final Optional userIdentityId; + + private final Optional isMultiPhoneSyncCredential; + + private final Map additionalProperties; + + private CredentialsListRequest( + Optional acsUserId, + Optional acsSystemId, + Optional userIdentityId, + Optional isMultiPhoneSyncCredential, + Map additionalProperties) { + this.acsUserId = acsUserId; + this.acsSystemId = acsSystemId; + this.userIdentityId = userIdentityId; + this.isMultiPhoneSyncCredential = isMultiPhoneSyncCredential; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public Optional getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_system_id") + public Optional getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("user_identity_id") + public Optional getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("is_multi_phone_sync_credential") + public Optional getIsMultiPhoneSyncCredential() { + return isMultiPhoneSyncCredential; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsListRequest && equalTo((CredentialsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsListRequest other) { + return acsUserId.equals(other.acsUserId) + && acsSystemId.equals(other.acsSystemId) + && userIdentityId.equals(other.userIdentityId) + && isMultiPhoneSyncCredential.equals(other.isMultiPhoneSyncCredential); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId, this.acsSystemId, this.userIdentityId, this.isMultiPhoneSyncCredential); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional acsUserId = Optional.empty(); + + private Optional acsSystemId = Optional.empty(); + + private Optional userIdentityId = Optional.empty(); + + private Optional isMultiPhoneSyncCredential = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CredentialsListRequest other) { + acsUserId(other.getAcsUserId()); + acsSystemId(other.getAcsSystemId()); + userIdentityId(other.getUserIdentityId()); + isMultiPhoneSyncCredential(other.getIsMultiPhoneSyncCredential()); + return this; + } + + @JsonSetter(value = "acs_user_id", nulls = Nulls.SKIP) + public Builder acsUserId(Optional acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + public Builder acsUserId(String acsUserId) { + this.acsUserId = Optional.of(acsUserId); + return this; + } + + @JsonSetter(value = "acs_system_id", nulls = Nulls.SKIP) + public Builder acsSystemId(Optional acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + public Builder acsSystemId(String acsSystemId) { + this.acsSystemId = Optional.of(acsSystemId); + return this; + } + + @JsonSetter(value = "user_identity_id", nulls = Nulls.SKIP) + public Builder userIdentityId(Optional userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + public Builder userIdentityId(String userIdentityId) { + this.userIdentityId = Optional.of(userIdentityId); + return this; + } + + @JsonSetter(value = "is_multi_phone_sync_credential", nulls = Nulls.SKIP) + public Builder isMultiPhoneSyncCredential(Optional isMultiPhoneSyncCredential) { + this.isMultiPhoneSyncCredential = isMultiPhoneSyncCredential; + return this; + } + + public Builder isMultiPhoneSyncCredential(Boolean isMultiPhoneSyncCredential) { + this.isMultiPhoneSyncCredential = Optional.of(isMultiPhoneSyncCredential); + return this; + } + + public CredentialsListRequest build() { + return new CredentialsListRequest( + acsUserId, acsSystemId, userIdentityId, isMultiPhoneSyncCredential, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUnassignRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUnassignRequest.java new file mode 100644 index 0000000..7861bc6 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUnassignRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsUnassignRequest.Builder.class) +public final class CredentialsUnassignRequest { + private final String acsUserId; + + private final String acsCredentialId; + + private final Map additionalProperties; + + private CredentialsUnassignRequest( + String acsUserId, String acsCredentialId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.acsCredentialId = acsCredentialId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_credential_id") + public String getAcsCredentialId() { + return acsCredentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsUnassignRequest && equalTo((CredentialsUnassignRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsUnassignRequest other) { + return acsUserId.equals(other.acsUserId) && acsCredentialId.equals(other.acsCredentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId, this.acsCredentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + AcsCredentialIdStage acsUserId(String acsUserId); + + Builder from(CredentialsUnassignRequest other); + } + + public interface AcsCredentialIdStage { + _FinalStage acsCredentialId(String acsCredentialId); + } + + public interface _FinalStage { + CredentialsUnassignRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, AcsCredentialIdStage, _FinalStage { + private String acsUserId; + + private String acsCredentialId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsUnassignRequest other) { + acsUserId(other.getAcsUserId()); + acsCredentialId(other.getAcsCredentialId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public AcsCredentialIdStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_id") + public _FinalStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + public CredentialsUnassignRequest build() { + return new CredentialsUnassignRequest(acsUserId, acsCredentialId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUpdateRequest.java b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUpdateRequest.java new file mode 100644 index 0000000..21e1f17 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/requests/CredentialsUpdateRequest.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsUpdateRequest.Builder.class) +public final class CredentialsUpdateRequest { + private final String acsCredentialId; + + private final Optional code; + + private final Optional endsAt; + + private final Map additionalProperties; + + private CredentialsUpdateRequest( + String acsCredentialId, + Optional code, + Optional endsAt, + Map additionalProperties) { + this.acsCredentialId = acsCredentialId; + this.code = code; + this.endsAt = endsAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_id") + public String getAcsCredentialId() { + return acsCredentialId; + } + + @JsonProperty("code") + public Optional getCode() { + return code; + } + + @JsonProperty("ends_at") + public Optional getEndsAt() { + return endsAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsUpdateRequest && equalTo((CredentialsUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsUpdateRequest other) { + return acsCredentialId.equals(other.acsCredentialId) && code.equals(other.code) && endsAt.equals(other.endsAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentialId, this.code, this.endsAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialIdStage { + _FinalStage acsCredentialId(String acsCredentialId); + + Builder from(CredentialsUpdateRequest other); + } + + public interface _FinalStage { + CredentialsUpdateRequest build(); + + _FinalStage code(Optional code); + + _FinalStage code(String code); + + _FinalStage endsAt(Optional endsAt); + + _FinalStage endsAt(OffsetDateTime endsAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialIdStage, _FinalStage { + private String acsCredentialId; + + private Optional endsAt = Optional.empty(); + + private Optional code = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsUpdateRequest other) { + acsCredentialId(other.getAcsCredentialId()); + code(other.getCode()); + endsAt(other.getEndsAt()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_id") + public _FinalStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + public _FinalStage endsAt(OffsetDateTime endsAt) { + this.endsAt = Optional.of(endsAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) + public _FinalStage endsAt(Optional endsAt) { + this.endsAt = endsAt; + return this; + } + + @java.lang.Override + public _FinalStage code(String code) { + this.code = Optional.of(code); + return this; + } + + @java.lang.Override + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public _FinalStage code(Optional code) { + this.code = code; + return this; + } + + @java.lang.Override + public CredentialsUpdateRequest build() { + return new CredentialsUpdateRequest(acsCredentialId, code, endsAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsAssignResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsAssignResponse.java new file mode 100644 index 0000000..a1ea1d2 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsAssignResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredential; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsAssignResponse.Builder.class) +public final class CredentialsAssignResponse { + private final AcsCredential acsCredential; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsAssignResponse( + AcsCredential acsCredential, boolean ok, Map additionalProperties) { + this.acsCredential = acsCredential; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential") + public AcsCredential getAcsCredential() { + return acsCredential; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsAssignResponse && equalTo((CredentialsAssignResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsAssignResponse other) { + return acsCredential.equals(other.acsCredential) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredential, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialStage builder() { + return new Builder(); + } + + public interface AcsCredentialStage { + OkStage acsCredential(AcsCredential acsCredential); + + Builder from(CredentialsAssignResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + CredentialsAssignResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialStage, OkStage, _FinalStage { + private AcsCredential acsCredential; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsAssignResponse other) { + acsCredential(other.getAcsCredential()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential") + public OkStage acsCredential(AcsCredential acsCredential) { + this.acsCredential = acsCredential; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public CredentialsAssignResponse build() { + return new CredentialsAssignResponse(acsCredential, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestAccessMethod.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestAccessMethod.java new file mode 100644 index 0000000..4225989 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestAccessMethod.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CredentialsCreateRequestAccessMethod { + CODE("code"), + + CARD("card"), + + MOBILE_KEY("mobile_key"); + + private final String value; + + CredentialsCreateRequestAccessMethod(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadata.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadata.java new file mode 100644 index 0000000..2046890 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadata.java @@ -0,0 +1,235 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsCreateRequestVisionlineMetadata.Builder.class) +public final class CredentialsCreateRequestVisionlineMetadata { + private final Optional assaAbloyCredentialServiceMobileEndpointId; + + private final Optional cardFormat; + + private final Optional cardFunctionType; + + private final Optional isOverrideKey; + + private final Optional override; + + private final Optional> joinerAcsCredentialIds; + + private final Map additionalProperties; + + private CredentialsCreateRequestVisionlineMetadata( + Optional assaAbloyCredentialServiceMobileEndpointId, + Optional cardFormat, + Optional cardFunctionType, + Optional isOverrideKey, + Optional override, + Optional> joinerAcsCredentialIds, + Map additionalProperties) { + this.assaAbloyCredentialServiceMobileEndpointId = assaAbloyCredentialServiceMobileEndpointId; + this.cardFormat = cardFormat; + this.cardFunctionType = cardFunctionType; + this.isOverrideKey = isOverrideKey; + this.override = override; + this.joinerAcsCredentialIds = joinerAcsCredentialIds; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("assa_abloy_credential_service_mobile_endpoint_id") + public Optional getAssaAbloyCredentialServiceMobileEndpointId() { + return assaAbloyCredentialServiceMobileEndpointId; + } + + @JsonProperty("card_format") + public Optional getCardFormat() { + return cardFormat; + } + + @JsonProperty("card_function_type") + public Optional getCardFunctionType() { + return cardFunctionType; + } + + @JsonProperty("is_override_key") + public Optional getIsOverrideKey() { + return isOverrideKey; + } + + @JsonProperty("override") + public Optional getOverride() { + return override; + } + + @JsonProperty("joiner_acs_credential_ids") + public Optional> getJoinerAcsCredentialIds() { + return joinerAcsCredentialIds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsCreateRequestVisionlineMetadata + && equalTo((CredentialsCreateRequestVisionlineMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsCreateRequestVisionlineMetadata other) { + return assaAbloyCredentialServiceMobileEndpointId.equals(other.assaAbloyCredentialServiceMobileEndpointId) + && cardFormat.equals(other.cardFormat) + && cardFunctionType.equals(other.cardFunctionType) + && isOverrideKey.equals(other.isOverrideKey) + && override.equals(other.override) + && joinerAcsCredentialIds.equals(other.joinerAcsCredentialIds); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.assaAbloyCredentialServiceMobileEndpointId, + this.cardFormat, + this.cardFunctionType, + this.isOverrideKey, + this.override, + this.joinerAcsCredentialIds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional assaAbloyCredentialServiceMobileEndpointId = Optional.empty(); + + private Optional cardFormat = Optional.empty(); + + private Optional cardFunctionType = + Optional.empty(); + + private Optional isOverrideKey = Optional.empty(); + + private Optional override = Optional.empty(); + + private Optional> joinerAcsCredentialIds = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CredentialsCreateRequestVisionlineMetadata other) { + assaAbloyCredentialServiceMobileEndpointId(other.getAssaAbloyCredentialServiceMobileEndpointId()); + cardFormat(other.getCardFormat()); + cardFunctionType(other.getCardFunctionType()); + isOverrideKey(other.getIsOverrideKey()); + override(other.getOverride()); + joinerAcsCredentialIds(other.getJoinerAcsCredentialIds()); + return this; + } + + @JsonSetter(value = "assa_abloy_credential_service_mobile_endpoint_id", nulls = Nulls.SKIP) + public Builder assaAbloyCredentialServiceMobileEndpointId( + Optional assaAbloyCredentialServiceMobileEndpointId) { + this.assaAbloyCredentialServiceMobileEndpointId = assaAbloyCredentialServiceMobileEndpointId; + return this; + } + + public Builder assaAbloyCredentialServiceMobileEndpointId(String assaAbloyCredentialServiceMobileEndpointId) { + this.assaAbloyCredentialServiceMobileEndpointId = Optional.of(assaAbloyCredentialServiceMobileEndpointId); + return this; + } + + @JsonSetter(value = "card_format", nulls = Nulls.SKIP) + public Builder cardFormat(Optional cardFormat) { + this.cardFormat = cardFormat; + return this; + } + + public Builder cardFormat(CredentialsCreateRequestVisionlineMetadataCardFormat cardFormat) { + this.cardFormat = Optional.of(cardFormat); + return this; + } + + @JsonSetter(value = "card_function_type", nulls = Nulls.SKIP) + public Builder cardFunctionType( + Optional cardFunctionType) { + this.cardFunctionType = cardFunctionType; + return this; + } + + public Builder cardFunctionType(CredentialsCreateRequestVisionlineMetadataCardFunctionType cardFunctionType) { + this.cardFunctionType = Optional.of(cardFunctionType); + return this; + } + + @JsonSetter(value = "is_override_key", nulls = Nulls.SKIP) + public Builder isOverrideKey(Optional isOverrideKey) { + this.isOverrideKey = isOverrideKey; + return this; + } + + public Builder isOverrideKey(Boolean isOverrideKey) { + this.isOverrideKey = Optional.of(isOverrideKey); + return this; + } + + @JsonSetter(value = "override", nulls = Nulls.SKIP) + public Builder override(Optional override) { + this.override = override; + return this; + } + + public Builder override(Boolean override) { + this.override = Optional.of(override); + return this; + } + + @JsonSetter(value = "joiner_acs_credential_ids", nulls = Nulls.SKIP) + public Builder joinerAcsCredentialIds(Optional> joinerAcsCredentialIds) { + this.joinerAcsCredentialIds = joinerAcsCredentialIds; + return this; + } + + public Builder joinerAcsCredentialIds(List joinerAcsCredentialIds) { + this.joinerAcsCredentialIds = Optional.of(joinerAcsCredentialIds); + return this; + } + + public CredentialsCreateRequestVisionlineMetadata build() { + return new CredentialsCreateRequestVisionlineMetadata( + assaAbloyCredentialServiceMobileEndpointId, + cardFormat, + cardFunctionType, + isOverrideKey, + override, + joinerAcsCredentialIds, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFormat.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFormat.java new file mode 100644 index 0000000..155da7d --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFormat.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CredentialsCreateRequestVisionlineMetadataCardFormat { + TL_CODE("TLCode"), + + RFID_48("rfid48"); + + private final String value; + + CredentialsCreateRequestVisionlineMetadataCardFormat(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFunctionType.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFunctionType.java new file mode 100644 index 0000000..e57930e --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateRequestVisionlineMetadataCardFunctionType.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CredentialsCreateRequestVisionlineMetadataCardFunctionType { + GUEST("guest"), + + STAFF("staff"); + + private final String value; + + CredentialsCreateRequestVisionlineMetadataCardFunctionType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateResponse.java new file mode 100644 index 0000000..95518b9 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsCreateResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredential; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsCreateResponse.Builder.class) +public final class CredentialsCreateResponse { + private final AcsCredential acsCredential; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsCreateResponse( + AcsCredential acsCredential, boolean ok, Map additionalProperties) { + this.acsCredential = acsCredential; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential") + public AcsCredential getAcsCredential() { + return acsCredential; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsCreateResponse && equalTo((CredentialsCreateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsCreateResponse other) { + return acsCredential.equals(other.acsCredential) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredential, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialStage builder() { + return new Builder(); + } + + public interface AcsCredentialStage { + OkStage acsCredential(AcsCredential acsCredential); + + Builder from(CredentialsCreateResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + CredentialsCreateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialStage, OkStage, _FinalStage { + private AcsCredential acsCredential; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsCreateResponse other) { + acsCredential(other.getAcsCredential()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential") + public OkStage acsCredential(AcsCredential acsCredential) { + this.acsCredential = acsCredential; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public CredentialsCreateResponse build() { + return new CredentialsCreateResponse(acsCredential, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsDeleteResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsDeleteResponse.java new file mode 100644 index 0000000..138ccd0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsDeleteResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsDeleteResponse.Builder.class) +public final class CredentialsDeleteResponse { + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsDeleteResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsDeleteResponse && equalTo((CredentialsDeleteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsDeleteResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(CredentialsDeleteResponse other); + } + + public interface _FinalStage { + CredentialsDeleteResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsDeleteResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public CredentialsDeleteResponse build() { + return new CredentialsDeleteResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsGetResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsGetResponse.java new file mode 100644 index 0000000..ac18dae --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsGetResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredential; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsGetResponse.Builder.class) +public final class CredentialsGetResponse { + private final AcsCredential acsCredential; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsGetResponse(AcsCredential acsCredential, boolean ok, Map additionalProperties) { + this.acsCredential = acsCredential; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential") + public AcsCredential getAcsCredential() { + return acsCredential; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsGetResponse && equalTo((CredentialsGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsGetResponse other) { + return acsCredential.equals(other.acsCredential) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredential, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialStage builder() { + return new Builder(); + } + + public interface AcsCredentialStage { + OkStage acsCredential(AcsCredential acsCredential); + + Builder from(CredentialsGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + CredentialsGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialStage, OkStage, _FinalStage { + private AcsCredential acsCredential; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsGetResponse other) { + acsCredential(other.getAcsCredential()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential") + public OkStage acsCredential(AcsCredential acsCredential) { + this.acsCredential = acsCredential; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public CredentialsGetResponse build() { + return new CredentialsGetResponse(acsCredential, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListAccessibleEntrancesResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListAccessibleEntrancesResponse.java new file mode 100644 index 0000000..90eed39 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListAccessibleEntrancesResponse.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsEntrance; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsListAccessibleEntrancesResponse.Builder.class) +public final class CredentialsListAccessibleEntrancesResponse { + private final List acsEntrances; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsListAccessibleEntrancesResponse( + List acsEntrances, boolean ok, Map additionalProperties) { + this.acsEntrances = acsEntrances; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_entrances") + public List getAcsEntrances() { + return acsEntrances; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsListAccessibleEntrancesResponse + && equalTo((CredentialsListAccessibleEntrancesResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsListAccessibleEntrancesResponse other) { + return acsEntrances.equals(other.acsEntrances) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsEntrances, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(CredentialsListAccessibleEntrancesResponse other); + } + + public interface _FinalStage { + CredentialsListAccessibleEntrancesResponse build(); + + _FinalStage acsEntrances(List acsEntrances); + + _FinalStage addAcsEntrances(AcsEntrance acsEntrances); + + _FinalStage addAllAcsEntrances(List acsEntrances); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsEntrances = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsListAccessibleEntrancesResponse other) { + acsEntrances(other.getAcsEntrances()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsEntrances(List acsEntrances) { + this.acsEntrances.addAll(acsEntrances); + return this; + } + + @java.lang.Override + public _FinalStage addAcsEntrances(AcsEntrance acsEntrances) { + this.acsEntrances.add(acsEntrances); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_entrances", nulls = Nulls.SKIP) + public _FinalStage acsEntrances(List acsEntrances) { + this.acsEntrances.clear(); + this.acsEntrances.addAll(acsEntrances); + return this; + } + + @java.lang.Override + public CredentialsListAccessibleEntrancesResponse build() { + return new CredentialsListAccessibleEntrancesResponse(acsEntrances, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListResponse.java new file mode 100644 index 0000000..85c6b84 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsListResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredential; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsListResponse.Builder.class) +public final class CredentialsListResponse { + private final List acsCredentials; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsListResponse( + List acsCredentials, boolean ok, Map additionalProperties) { + this.acsCredentials = acsCredentials; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credentials") + public List getAcsCredentials() { + return acsCredentials; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsListResponse && equalTo((CredentialsListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsListResponse other) { + return acsCredentials.equals(other.acsCredentials) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentials, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(CredentialsListResponse other); + } + + public interface _FinalStage { + CredentialsListResponse build(); + + _FinalStage acsCredentials(List acsCredentials); + + _FinalStage addAcsCredentials(AcsCredential acsCredentials); + + _FinalStage addAllAcsCredentials(List acsCredentials); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsCredentials = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsListResponse other) { + acsCredentials(other.getAcsCredentials()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsCredentials(List acsCredentials) { + this.acsCredentials.addAll(acsCredentials); + return this; + } + + @java.lang.Override + public _FinalStage addAcsCredentials(AcsCredential acsCredentials) { + this.acsCredentials.add(acsCredentials); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_credentials", nulls = Nulls.SKIP) + public _FinalStage acsCredentials(List acsCredentials) { + this.acsCredentials.clear(); + this.acsCredentials.addAll(acsCredentials); + return this; + } + + @java.lang.Override + public CredentialsListResponse build() { + return new CredentialsListResponse(acsCredentials, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUnassignResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUnassignResponse.java new file mode 100644 index 0000000..427a83d --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUnassignResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredential; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsUnassignResponse.Builder.class) +public final class CredentialsUnassignResponse { + private final AcsCredential acsCredential; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsUnassignResponse( + AcsCredential acsCredential, boolean ok, Map additionalProperties) { + this.acsCredential = acsCredential; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential") + public AcsCredential getAcsCredential() { + return acsCredential; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsUnassignResponse && equalTo((CredentialsUnassignResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsUnassignResponse other) { + return acsCredential.equals(other.acsCredential) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredential, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialStage builder() { + return new Builder(); + } + + public interface AcsCredentialStage { + OkStage acsCredential(AcsCredential acsCredential); + + Builder from(CredentialsUnassignResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + CredentialsUnassignResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialStage, OkStage, _FinalStage { + private AcsCredential acsCredential; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsUnassignResponse other) { + acsCredential(other.getAcsCredential()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential") + public OkStage acsCredential(AcsCredential acsCredential) { + this.acsCredential = acsCredential; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public CredentialsUnassignResponse build() { + return new CredentialsUnassignResponse(acsCredential, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUpdateResponse.java b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUpdateResponse.java new file mode 100644 index 0000000..6f22691 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/credentials/types/CredentialsUpdateResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.credentials.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredential; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = CredentialsUpdateResponse.Builder.class) +public final class CredentialsUpdateResponse { + private final AcsCredential acsCredential; + + private final boolean ok; + + private final Map additionalProperties; + + private CredentialsUpdateResponse( + AcsCredential acsCredential, boolean ok, Map additionalProperties) { + this.acsCredential = acsCredential; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential") + public AcsCredential getAcsCredential() { + return acsCredential; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CredentialsUpdateResponse && equalTo((CredentialsUpdateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CredentialsUpdateResponse other) { + return acsCredential.equals(other.acsCredential) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredential, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialStage builder() { + return new Builder(); + } + + public interface AcsCredentialStage { + OkStage acsCredential(AcsCredential acsCredential); + + Builder from(CredentialsUpdateResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + CredentialsUpdateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsCredentialStage, OkStage, _FinalStage { + private AcsCredential acsCredential; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CredentialsUpdateResponse other) { + acsCredential(other.getAcsCredential()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential") + public OkStage acsCredential(AcsCredential acsCredential) { + this.acsCredential = acsCredential; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public CredentialsUpdateResponse build() { + return new CredentialsUpdateResponse(acsCredential, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/EntrancesClient.java b/src/main/java/com/seam/api/resources/acs/entrances/EntrancesClient.java new file mode 100644 index 0000000..4b9a31d --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/EntrancesClient.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.acs.entrances.requests.EntrancesGetRequest; +import com.seam.api.resources.acs.entrances.requests.EntrancesGrantAccessRequest; +import com.seam.api.resources.acs.entrances.requests.EntrancesListCredentialsWithAccessRequest; +import com.seam.api.resources.acs.entrances.requests.EntrancesListRequest; +import com.seam.api.resources.acs.entrances.types.EntrancesGetResponse; +import com.seam.api.resources.acs.entrances.types.EntrancesGrantAccessResponse; +import com.seam.api.resources.acs.entrances.types.EntrancesListCredentialsWithAccessResponse; +import com.seam.api.resources.acs.entrances.types.EntrancesListResponse; +import com.seam.api.types.AcsCredential; +import com.seam.api.types.AcsEntrance; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class EntrancesClient { + protected final ClientOptions clientOptions; + + public EntrancesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public AcsEntrance get(EntrancesGetRequest request) { + return get(request, null); + } + + public AcsEntrance get(EntrancesGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/entrances/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + EntrancesGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EntrancesGetResponse.class); + return parsedResponse.getAcsEntrance(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public EntrancesGrantAccessResponse grantAccess(EntrancesGrantAccessRequest request) { + return grantAccess(request, null); + } + + public EntrancesGrantAccessResponse grantAccess( + EntrancesGrantAccessRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/entrances/grant_access") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EntrancesGrantAccessResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(EntrancesListRequest.builder().build()); + } + + public List list(EntrancesListRequest request) { + return list(request, null); + } + + public List list(EntrancesListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/entrances/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + EntrancesListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EntrancesListResponse.class); + return parsedResponse.getAcsEntrances(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listCredentialsWithAccess(EntrancesListCredentialsWithAccessRequest request) { + return listCredentialsWithAccess(request, null); + } + + public List listCredentialsWithAccess( + EntrancesListCredentialsWithAccessRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/entrances/list_credentials_with_access") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + EntrancesListCredentialsWithAccessResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), EntrancesListCredentialsWithAccessResponse.class); + return parsedResponse.getAcsCredentials(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGetRequest.java b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGetRequest.java new file mode 100644 index 0000000..0476729 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGetRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesGetRequest.Builder.class) +public final class EntrancesGetRequest { + private final String acsEntranceId; + + private final Map additionalProperties; + + private EntrancesGetRequest(String acsEntranceId, Map additionalProperties) { + this.acsEntranceId = acsEntranceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_entrance_id") + public String getAcsEntranceId() { + return acsEntranceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesGetRequest && equalTo((EntrancesGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesGetRequest other) { + return acsEntranceId.equals(other.acsEntranceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsEntranceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsEntranceIdStage builder() { + return new Builder(); + } + + public interface AcsEntranceIdStage { + _FinalStage acsEntranceId(String acsEntranceId); + + Builder from(EntrancesGetRequest other); + } + + public interface _FinalStage { + EntrancesGetRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsEntranceIdStage, _FinalStage { + private String acsEntranceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EntrancesGetRequest other) { + acsEntranceId(other.getAcsEntranceId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_entrance_id") + public _FinalStage acsEntranceId(String acsEntranceId) { + this.acsEntranceId = acsEntranceId; + return this; + } + + @java.lang.Override + public EntrancesGetRequest build() { + return new EntrancesGetRequest(acsEntranceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGrantAccessRequest.java b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGrantAccessRequest.java new file mode 100644 index 0000000..f96c0bd --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesGrantAccessRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesGrantAccessRequest.Builder.class) +public final class EntrancesGrantAccessRequest { + private final String acsEntranceId; + + private final String acsUserId; + + private final Map additionalProperties; + + private EntrancesGrantAccessRequest( + String acsEntranceId, String acsUserId, Map additionalProperties) { + this.acsEntranceId = acsEntranceId; + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_entrance_id") + public String getAcsEntranceId() { + return acsEntranceId; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesGrantAccessRequest && equalTo((EntrancesGrantAccessRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesGrantAccessRequest other) { + return acsEntranceId.equals(other.acsEntranceId) && acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsEntranceId, this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsEntranceIdStage builder() { + return new Builder(); + } + + public interface AcsEntranceIdStage { + AcsUserIdStage acsEntranceId(String acsEntranceId); + + Builder from(EntrancesGrantAccessRequest other); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + } + + public interface _FinalStage { + EntrancesGrantAccessRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsEntranceIdStage, AcsUserIdStage, _FinalStage { + private String acsEntranceId; + + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EntrancesGrantAccessRequest other) { + acsEntranceId(other.getAcsEntranceId()); + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_entrance_id") + public AcsUserIdStage acsEntranceId(String acsEntranceId) { + this.acsEntranceId = acsEntranceId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public EntrancesGrantAccessRequest build() { + return new EntrancesGrantAccessRequest(acsEntranceId, acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListCredentialsWithAccessRequest.java b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListCredentialsWithAccessRequest.java new file mode 100644 index 0000000..cfa584d --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListCredentialsWithAccessRequest.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesListCredentialsWithAccessRequest.Builder.class) +public final class EntrancesListCredentialsWithAccessRequest { + private final String acsEntranceId; + + private final Optional> includeIf; + + private final Map additionalProperties; + + private EntrancesListCredentialsWithAccessRequest( + String acsEntranceId, Optional> includeIf, Map additionalProperties) { + this.acsEntranceId = acsEntranceId; + this.includeIf = includeIf; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_entrance_id") + public String getAcsEntranceId() { + return acsEntranceId; + } + + @JsonProperty("include_if") + public Optional> getIncludeIf() { + return includeIf; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesListCredentialsWithAccessRequest + && equalTo((EntrancesListCredentialsWithAccessRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesListCredentialsWithAccessRequest other) { + return acsEntranceId.equals(other.acsEntranceId) && includeIf.equals(other.includeIf); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsEntranceId, this.includeIf); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsEntranceIdStage builder() { + return new Builder(); + } + + public interface AcsEntranceIdStage { + _FinalStage acsEntranceId(String acsEntranceId); + + Builder from(EntrancesListCredentialsWithAccessRequest other); + } + + public interface _FinalStage { + EntrancesListCredentialsWithAccessRequest build(); + + _FinalStage includeIf(Optional> includeIf); + + _FinalStage includeIf(List includeIf); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsEntranceIdStage, _FinalStage { + private String acsEntranceId; + + private Optional> includeIf = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EntrancesListCredentialsWithAccessRequest other) { + acsEntranceId(other.getAcsEntranceId()); + includeIf(other.getIncludeIf()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_entrance_id") + public _FinalStage acsEntranceId(String acsEntranceId) { + this.acsEntranceId = acsEntranceId; + return this; + } + + @java.lang.Override + public _FinalStage includeIf(List includeIf) { + this.includeIf = Optional.of(includeIf); + return this; + } + + @java.lang.Override + @JsonSetter(value = "include_if", nulls = Nulls.SKIP) + public _FinalStage includeIf(Optional> includeIf) { + this.includeIf = includeIf; + return this; + } + + @java.lang.Override + public EntrancesListCredentialsWithAccessRequest build() { + return new EntrancesListCredentialsWithAccessRequest(acsEntranceId, includeIf, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListRequest.java b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListRequest.java new file mode 100644 index 0000000..1f2e281 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/requests/EntrancesListRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesListRequest.Builder.class) +public final class EntrancesListRequest { + private final Optional acsSystemId; + + private final Optional acsCredentialId; + + private final Map additionalProperties; + + private EntrancesListRequest( + Optional acsSystemId, Optional acsCredentialId, Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.acsCredentialId = acsCredentialId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public Optional getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("acs_credential_id") + public Optional getAcsCredentialId() { + return acsCredentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesListRequest && equalTo((EntrancesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesListRequest other) { + return acsSystemId.equals(other.acsSystemId) && acsCredentialId.equals(other.acsCredentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystemId, this.acsCredentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional acsSystemId = Optional.empty(); + + private Optional acsCredentialId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EntrancesListRequest other) { + acsSystemId(other.getAcsSystemId()); + acsCredentialId(other.getAcsCredentialId()); + return this; + } + + @JsonSetter(value = "acs_system_id", nulls = Nulls.SKIP) + public Builder acsSystemId(Optional acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + public Builder acsSystemId(String acsSystemId) { + this.acsSystemId = Optional.of(acsSystemId); + return this; + } + + @JsonSetter(value = "acs_credential_id", nulls = Nulls.SKIP) + public Builder acsCredentialId(Optional acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + public Builder acsCredentialId(String acsCredentialId) { + this.acsCredentialId = Optional.of(acsCredentialId); + return this; + } + + public EntrancesListRequest build() { + return new EntrancesListRequest(acsSystemId, acsCredentialId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGetResponse.java b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGetResponse.java new file mode 100644 index 0000000..c7a7326 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGetResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsEntrance; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesGetResponse.Builder.class) +public final class EntrancesGetResponse { + private final AcsEntrance acsEntrance; + + private final boolean ok; + + private final Map additionalProperties; + + private EntrancesGetResponse(AcsEntrance acsEntrance, boolean ok, Map additionalProperties) { + this.acsEntrance = acsEntrance; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_entrance") + public AcsEntrance getAcsEntrance() { + return acsEntrance; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesGetResponse && equalTo((EntrancesGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesGetResponse other) { + return acsEntrance.equals(other.acsEntrance) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsEntrance, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsEntranceStage builder() { + return new Builder(); + } + + public interface AcsEntranceStage { + OkStage acsEntrance(AcsEntrance acsEntrance); + + Builder from(EntrancesGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + EntrancesGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsEntranceStage, OkStage, _FinalStage { + private AcsEntrance acsEntrance; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EntrancesGetResponse other) { + acsEntrance(other.getAcsEntrance()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_entrance") + public OkStage acsEntrance(AcsEntrance acsEntrance) { + this.acsEntrance = acsEntrance; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public EntrancesGetResponse build() { + return new EntrancesGetResponse(acsEntrance, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGrantAccessResponse.java b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGrantAccessResponse.java new file mode 100644 index 0000000..1f757e3 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesGrantAccessResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesGrantAccessResponse.Builder.class) +public final class EntrancesGrantAccessResponse { + private final boolean ok; + + private final Map additionalProperties; + + private EntrancesGrantAccessResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesGrantAccessResponse && equalTo((EntrancesGrantAccessResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesGrantAccessResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(EntrancesGrantAccessResponse other); + } + + public interface _FinalStage { + EntrancesGrantAccessResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EntrancesGrantAccessResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public EntrancesGrantAccessResponse build() { + return new EntrancesGrantAccessResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListCredentialsWithAccessResponse.java b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListCredentialsWithAccessResponse.java new file mode 100644 index 0000000..396fe51 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListCredentialsWithAccessResponse.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsCredential; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesListCredentialsWithAccessResponse.Builder.class) +public final class EntrancesListCredentialsWithAccessResponse { + private final List acsCredentials; + + private final boolean ok; + + private final Map additionalProperties; + + private EntrancesListCredentialsWithAccessResponse( + List acsCredentials, boolean ok, Map additionalProperties) { + this.acsCredentials = acsCredentials; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credentials") + public List getAcsCredentials() { + return acsCredentials; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesListCredentialsWithAccessResponse + && equalTo((EntrancesListCredentialsWithAccessResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesListCredentialsWithAccessResponse other) { + return acsCredentials.equals(other.acsCredentials) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsCredentials, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(EntrancesListCredentialsWithAccessResponse other); + } + + public interface _FinalStage { + EntrancesListCredentialsWithAccessResponse build(); + + _FinalStage acsCredentials(List acsCredentials); + + _FinalStage addAcsCredentials(AcsCredential acsCredentials); + + _FinalStage addAllAcsCredentials(List acsCredentials); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsCredentials = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EntrancesListCredentialsWithAccessResponse other) { + acsCredentials(other.getAcsCredentials()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsCredentials(List acsCredentials) { + this.acsCredentials.addAll(acsCredentials); + return this; + } + + @java.lang.Override + public _FinalStage addAcsCredentials(AcsCredential acsCredentials) { + this.acsCredentials.add(acsCredentials); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_credentials", nulls = Nulls.SKIP) + public _FinalStage acsCredentials(List acsCredentials) { + this.acsCredentials.clear(); + this.acsCredentials.addAll(acsCredentials); + return this; + } + + @java.lang.Override + public EntrancesListCredentialsWithAccessResponse build() { + return new EntrancesListCredentialsWithAccessResponse(acsCredentials, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListResponse.java b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListResponse.java new file mode 100644 index 0000000..e531e9a --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/entrances/types/EntrancesListResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.entrances.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsEntrance; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EntrancesListResponse.Builder.class) +public final class EntrancesListResponse { + private final List acsEntrances; + + private final boolean ok; + + private final Map additionalProperties; + + private EntrancesListResponse( + List acsEntrances, boolean ok, Map additionalProperties) { + this.acsEntrances = acsEntrances; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_entrances") + public List getAcsEntrances() { + return acsEntrances; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EntrancesListResponse && equalTo((EntrancesListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EntrancesListResponse other) { + return acsEntrances.equals(other.acsEntrances) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsEntrances, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(EntrancesListResponse other); + } + + public interface _FinalStage { + EntrancesListResponse build(); + + _FinalStage acsEntrances(List acsEntrances); + + _FinalStage addAcsEntrances(AcsEntrance acsEntrances); + + _FinalStage addAllAcsEntrances(List acsEntrances); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsEntrances = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EntrancesListResponse other) { + acsEntrances(other.getAcsEntrances()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsEntrances(List acsEntrances) { + this.acsEntrances.addAll(acsEntrances); + return this; + } + + @java.lang.Override + public _FinalStage addAcsEntrances(AcsEntrance acsEntrances) { + this.acsEntrances.add(acsEntrances); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_entrances", nulls = Nulls.SKIP) + public _FinalStage acsEntrances(List acsEntrances) { + this.acsEntrances.clear(); + this.acsEntrances.addAll(acsEntrances); + return this; + } + + @java.lang.Override + public EntrancesListResponse build() { + return new EntrancesListResponse(acsEntrances, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/systems/SystemsClient.java b/src/main/java/com/seam/api/resources/acs/systems/SystemsClient.java new file mode 100644 index 0000000..dcdd1c0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/systems/SystemsClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.systems; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.acs.systems.requests.SystemsGetRequest; +import com.seam.api.resources.acs.systems.requests.SystemsListCompatibleCredentialManagerAcsSystemsRequest; +import com.seam.api.resources.acs.systems.requests.SystemsListRequest; +import com.seam.api.resources.acs.systems.types.SystemsGetResponse; +import com.seam.api.resources.acs.systems.types.SystemsListCompatibleCredentialManagerAcsSystemsResponse; +import com.seam.api.resources.acs.systems.types.SystemsListResponse; +import com.seam.api.types.AcsSystem; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SystemsClient { + protected final ClientOptions clientOptions; + + public SystemsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public AcsSystem get(SystemsGetRequest request) { + return get(request, null); + } + + public AcsSystem get(SystemsGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/systems/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + SystemsGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SystemsGetResponse.class); + return parsedResponse.getAcsSystem(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(SystemsListRequest.builder().build()); + } + + public List list(SystemsListRequest request) { + return list(request, null); + } + + public List list(SystemsListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/systems/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + SystemsListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SystemsListResponse.class); + return parsedResponse.getAcsSystems(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listCompatibleCredentialManagerAcsSystems( + SystemsListCompatibleCredentialManagerAcsSystemsRequest request) { + return listCompatibleCredentialManagerAcsSystems(request, null); + } + + public List listCompatibleCredentialManagerAcsSystems( + SystemsListCompatibleCredentialManagerAcsSystemsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/systems/list_compatible_credential_manager_acs_systems") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + SystemsListCompatibleCredentialManagerAcsSystemsResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), SystemsListCompatibleCredentialManagerAcsSystemsResponse.class); + return parsedResponse.getAcsSystems(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsGetRequest.java b/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsGetRequest.java new file mode 100644 index 0000000..b29dd99 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsGetRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.systems.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SystemsGetRequest.Builder.class) +public final class SystemsGetRequest { + private final String acsSystemId; + + private final Map additionalProperties; + + private SystemsGetRequest(String acsSystemId, Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SystemsGetRequest && equalTo((SystemsGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SystemsGetRequest other) { + return acsSystemId.equals(other.acsSystemId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystemId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsSystemIdStage builder() { + return new Builder(); + } + + public interface AcsSystemIdStage { + _FinalStage acsSystemId(String acsSystemId); + + Builder from(SystemsGetRequest other); + } + + public interface _FinalStage { + SystemsGetRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsSystemIdStage, _FinalStage { + private String acsSystemId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SystemsGetRequest other) { + acsSystemId(other.getAcsSystemId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public _FinalStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + public SystemsGetRequest build() { + return new SystemsGetRequest(acsSystemId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsListCompatibleCredentialManagerAcsSystemsRequest.java b/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsListCompatibleCredentialManagerAcsSystemsRequest.java new file mode 100644 index 0000000..dad77ba --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsListCompatibleCredentialManagerAcsSystemsRequest.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.systems.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SystemsListCompatibleCredentialManagerAcsSystemsRequest.Builder.class) +public final class SystemsListCompatibleCredentialManagerAcsSystemsRequest { + private final String acsSystemId; + + private final Map additionalProperties; + + private SystemsListCompatibleCredentialManagerAcsSystemsRequest( + String acsSystemId, Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SystemsListCompatibleCredentialManagerAcsSystemsRequest + && equalTo((SystemsListCompatibleCredentialManagerAcsSystemsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SystemsListCompatibleCredentialManagerAcsSystemsRequest other) { + return acsSystemId.equals(other.acsSystemId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystemId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsSystemIdStage builder() { + return new Builder(); + } + + public interface AcsSystemIdStage { + _FinalStage acsSystemId(String acsSystemId); + + Builder from(SystemsListCompatibleCredentialManagerAcsSystemsRequest other); + } + + public interface _FinalStage { + SystemsListCompatibleCredentialManagerAcsSystemsRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsSystemIdStage, _FinalStage { + private String acsSystemId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SystemsListCompatibleCredentialManagerAcsSystemsRequest other) { + acsSystemId(other.getAcsSystemId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public _FinalStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + public SystemsListCompatibleCredentialManagerAcsSystemsRequest build() { + return new SystemsListCompatibleCredentialManagerAcsSystemsRequest(acsSystemId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/NukiDeviceMetadata.java b/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsListRequest.java similarity index 50% rename from src/main/java/com/seam/api/types/NukiDeviceMetadata.java rename to src/main/java/com/seam/api/resources/acs/systems/requests/SystemsListRequest.java index c74caf9..a1efc01 100644 --- a/src/main/java/com/seam/api/types/NukiDeviceMetadata.java +++ b/src/main/java/com/seam/api/resources/acs/systems/requests/SystemsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.acs.systems.requests; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -18,26 +18,26 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = NukiDeviceMetadata.Builder.class) -public final class NukiDeviceMetadata { - private final Optional keypadBatteryCritical; +@JsonDeserialize(builder = SystemsListRequest.Builder.class) +public final class SystemsListRequest { + private final Optional connectedAccountId; private final Map additionalProperties; - private NukiDeviceMetadata(Optional keypadBatteryCritical, Map additionalProperties) { - this.keypadBatteryCritical = keypadBatteryCritical; + private SystemsListRequest(Optional connectedAccountId, Map additionalProperties) { + this.connectedAccountId = connectedAccountId; this.additionalProperties = additionalProperties; } - @JsonProperty("keypad_battery_critical") - public Optional getKeypadBatteryCritical() { - return keypadBatteryCritical; + @JsonProperty("connected_account_id") + public Optional getConnectedAccountId() { + return connectedAccountId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof NukiDeviceMetadata && equalTo((NukiDeviceMetadata) other); + return other instanceof SystemsListRequest && equalTo((SystemsListRequest) other); } @JsonAnyGetter @@ -45,16 +45,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(NukiDeviceMetadata other) { - return keypadBatteryCritical.equals(other.keypadBatteryCritical); + private boolean equalTo(SystemsListRequest other) { + return connectedAccountId.equals(other.connectedAccountId); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.keypadBatteryCritical); + return Objects.hash(this.connectedAccountId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -65,31 +65,31 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional keypadBatteryCritical = Optional.empty(); + private Optional connectedAccountId = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(NukiDeviceMetadata other) { - keypadBatteryCritical(other.getKeypadBatteryCritical()); + public Builder from(SystemsListRequest other) { + connectedAccountId(other.getConnectedAccountId()); return this; } - @JsonSetter(value = "keypad_battery_critical", nulls = Nulls.SKIP) - public Builder keypadBatteryCritical(Optional keypadBatteryCritical) { - this.keypadBatteryCritical = keypadBatteryCritical; + @JsonSetter(value = "connected_account_id", nulls = Nulls.SKIP) + public Builder connectedAccountId(Optional connectedAccountId) { + this.connectedAccountId = connectedAccountId; return this; } - public Builder keypadBatteryCritical(Boolean keypadBatteryCritical) { - this.keypadBatteryCritical = Optional.of(keypadBatteryCritical); + public Builder connectedAccountId(String connectedAccountId) { + this.connectedAccountId = Optional.of(connectedAccountId); return this; } - public NukiDeviceMetadata build() { - return new NukiDeviceMetadata(keypadBatteryCritical, additionalProperties); + public SystemsListRequest build() { + return new SystemsListRequest(connectedAccountId, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/acs/systems/types/SystemsGetResponse.java b/src/main/java/com/seam/api/resources/acs/systems/types/SystemsGetResponse.java new file mode 100644 index 0000000..fd33ddb --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/systems/types/SystemsGetResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.systems.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsSystem; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SystemsGetResponse.Builder.class) +public final class SystemsGetResponse { + private final AcsSystem acsSystem; + + private final boolean ok; + + private final Map additionalProperties; + + private SystemsGetResponse(AcsSystem acsSystem, boolean ok, Map additionalProperties) { + this.acsSystem = acsSystem; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system") + public AcsSystem getAcsSystem() { + return acsSystem; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SystemsGetResponse && equalTo((SystemsGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SystemsGetResponse other) { + return acsSystem.equals(other.acsSystem) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystem, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsSystemStage builder() { + return new Builder(); + } + + public interface AcsSystemStage { + OkStage acsSystem(AcsSystem acsSystem); + + Builder from(SystemsGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + SystemsGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsSystemStage, OkStage, _FinalStage { + private AcsSystem acsSystem; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SystemsGetResponse other) { + acsSystem(other.getAcsSystem()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_system") + public OkStage acsSystem(AcsSystem acsSystem) { + this.acsSystem = acsSystem; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public SystemsGetResponse build() { + return new SystemsGetResponse(acsSystem, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/systems/types/SystemsListCompatibleCredentialManagerAcsSystemsResponse.java b/src/main/java/com/seam/api/resources/acs/systems/types/SystemsListCompatibleCredentialManagerAcsSystemsResponse.java new file mode 100644 index 0000000..4c1be07 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/systems/types/SystemsListCompatibleCredentialManagerAcsSystemsResponse.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.systems.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsSystem; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SystemsListCompatibleCredentialManagerAcsSystemsResponse.Builder.class) +public final class SystemsListCompatibleCredentialManagerAcsSystemsResponse { + private final List acsSystems; + + private final boolean ok; + + private final Map additionalProperties; + + private SystemsListCompatibleCredentialManagerAcsSystemsResponse( + List acsSystems, boolean ok, Map additionalProperties) { + this.acsSystems = acsSystems; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_systems") + public List getAcsSystems() { + return acsSystems; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SystemsListCompatibleCredentialManagerAcsSystemsResponse + && equalTo((SystemsListCompatibleCredentialManagerAcsSystemsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SystemsListCompatibleCredentialManagerAcsSystemsResponse other) { + return acsSystems.equals(other.acsSystems) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystems, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(SystemsListCompatibleCredentialManagerAcsSystemsResponse other); + } + + public interface _FinalStage { + SystemsListCompatibleCredentialManagerAcsSystemsResponse build(); + + _FinalStage acsSystems(List acsSystems); + + _FinalStage addAcsSystems(AcsSystem acsSystems); + + _FinalStage addAllAcsSystems(List acsSystems); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsSystems = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SystemsListCompatibleCredentialManagerAcsSystemsResponse other) { + acsSystems(other.getAcsSystems()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsSystems(List acsSystems) { + this.acsSystems.addAll(acsSystems); + return this; + } + + @java.lang.Override + public _FinalStage addAcsSystems(AcsSystem acsSystems) { + this.acsSystems.add(acsSystems); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_systems", nulls = Nulls.SKIP) + public _FinalStage acsSystems(List acsSystems) { + this.acsSystems.clear(); + this.acsSystems.addAll(acsSystems); + return this; + } + + @java.lang.Override + public SystemsListCompatibleCredentialManagerAcsSystemsResponse build() { + return new SystemsListCompatibleCredentialManagerAcsSystemsResponse(acsSystems, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/systems/types/SystemsListResponse.java b/src/main/java/com/seam/api/resources/acs/systems/types/SystemsListResponse.java new file mode 100644 index 0000000..3216e20 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/systems/types/SystemsListResponse.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.systems.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsSystem; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SystemsListResponse.Builder.class) +public final class SystemsListResponse { + private final List acsSystems; + + private final boolean ok; + + private final Map additionalProperties; + + private SystemsListResponse(List acsSystems, boolean ok, Map additionalProperties) { + this.acsSystems = acsSystems; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_systems") + public List getAcsSystems() { + return acsSystems; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SystemsListResponse && equalTo((SystemsListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SystemsListResponse other) { + return acsSystems.equals(other.acsSystems) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystems, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(SystemsListResponse other); + } + + public interface _FinalStage { + SystemsListResponse build(); + + _FinalStage acsSystems(List acsSystems); + + _FinalStage addAcsSystems(AcsSystem acsSystems); + + _FinalStage addAllAcsSystems(List acsSystems); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsSystems = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SystemsListResponse other) { + acsSystems(other.getAcsSystems()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsSystems(List acsSystems) { + this.acsSystems.addAll(acsSystems); + return this; + } + + @java.lang.Override + public _FinalStage addAcsSystems(AcsSystem acsSystems) { + this.acsSystems.add(acsSystems); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_systems", nulls = Nulls.SKIP) + public _FinalStage acsSystems(List acsSystems) { + this.acsSystems.clear(); + this.acsSystems.addAll(acsSystems); + return this; + } + + @java.lang.Override + public SystemsListResponse build() { + return new SystemsListResponse(acsSystems, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/UsersClient.java b/src/main/java/com/seam/api/resources/acs/users/UsersClient.java new file mode 100644 index 0000000..35ff4af --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/UsersClient.java @@ -0,0 +1,657 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.acs.users.requests.UsersAddToAccessGroupRequest; +import com.seam.api.resources.acs.users.requests.UsersCreateRequest; +import com.seam.api.resources.acs.users.requests.UsersDeleteRequest; +import com.seam.api.resources.acs.users.requests.UsersGetRequest; +import com.seam.api.resources.acs.users.requests.UsersListAccessibleEntrancesRequest; +import com.seam.api.resources.acs.users.requests.UsersListRequest; +import com.seam.api.resources.acs.users.requests.UsersRemoveFromAccessGroupRequest; +import com.seam.api.resources.acs.users.requests.UsersRevokeAccessToAllEntrancesRequest; +import com.seam.api.resources.acs.users.requests.UsersSuspendRequest; +import com.seam.api.resources.acs.users.requests.UsersUnsuspendRequest; +import com.seam.api.resources.acs.users.requests.UsersUpdateRequest; +import com.seam.api.resources.acs.users.types.UsersAddToAccessGroupResponse; +import com.seam.api.resources.acs.users.types.UsersCreateResponse; +import com.seam.api.resources.acs.users.types.UsersDeleteResponse; +import com.seam.api.resources.acs.users.types.UsersGetResponse; +import com.seam.api.resources.acs.users.types.UsersListAccessibleEntrancesResponse; +import com.seam.api.resources.acs.users.types.UsersListResponse; +import com.seam.api.resources.acs.users.types.UsersRemoveFromAccessGroupResponse; +import com.seam.api.resources.acs.users.types.UsersRevokeAccessToAllEntrancesResponse; +import com.seam.api.resources.acs.users.types.UsersSuspendResponse; +import com.seam.api.resources.acs.users.types.UsersUnsuspendResponse; +import com.seam.api.resources.acs.users.types.UsersUpdateResponse; +import com.seam.api.types.AcsEntrance; +import com.seam.api.types.AcsUser; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class UsersClient { + protected final ClientOptions clientOptions; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public UsersAddToAccessGroupResponse addToAccessGroup(UsersAddToAccessGroupRequest request) { + return addToAccessGroup(request, null); + } + + public UsersAddToAccessGroupResponse addToAccessGroup( + UsersAddToAccessGroupRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/add_to_access_group") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersAddToAccessGroupResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public AcsUser create(UsersCreateRequest request) { + return create(request, null); + } + + public AcsUser create(UsersCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/create") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UsersCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersCreateResponse.class); + return parsedResponse.getAcsUser(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UsersDeleteResponse delete(UsersDeleteRequest request) { + return delete(request, null); + } + + public UsersDeleteResponse delete(UsersDeleteRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/delete") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public AcsUser get(UsersGetRequest request) { + return get(request, null); + } + + public AcsUser get(UsersGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UsersGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersGetResponse.class); + return parsedResponse.getAcsUser(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(UsersListRequest.builder().build()); + } + + public List list(UsersListRequest request) { + return list(request, null); + } + + public List list(UsersListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UsersListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersListResponse.class); + return parsedResponse.getAcsUsers(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listAccessibleEntrances(UsersListAccessibleEntrancesRequest request) { + return listAccessibleEntrances(request, null); + } + + public List listAccessibleEntrances( + UsersListAccessibleEntrancesRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/list_accessible_entrances") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UsersListAccessibleEntrancesResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UsersListAccessibleEntrancesResponse.class); + return parsedResponse.getAcsEntrances(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UsersRemoveFromAccessGroupResponse removeFromAccessGroup(UsersRemoveFromAccessGroupRequest request) { + return removeFromAccessGroup(request, null); + } + + public UsersRemoveFromAccessGroupResponse removeFromAccessGroup( + UsersRemoveFromAccessGroupRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/remove_from_access_group") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UsersRemoveFromAccessGroupResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UsersRevokeAccessToAllEntrancesResponse revokeAccessToAllEntrances( + UsersRevokeAccessToAllEntrancesRequest request) { + return revokeAccessToAllEntrances(request, null); + } + + public UsersRevokeAccessToAllEntrancesResponse revokeAccessToAllEntrances( + UsersRevokeAccessToAllEntrancesRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/revoke_access_to_all_entrances") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UsersRevokeAccessToAllEntrancesResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UsersSuspendResponse suspend(UsersSuspendRequest request) { + return suspend(request, null); + } + + public UsersSuspendResponse suspend(UsersSuspendRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/suspend") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersSuspendResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UsersUnsuspendResponse unsuspend(UsersUnsuspendRequest request) { + return unsuspend(request, null); + } + + public UsersUnsuspendResponse unsuspend(UsersUnsuspendRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/unsuspend") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersUnsuspendResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UsersUpdateResponse update(UsersUpdateRequest request) { + return update(request, null); + } + + public UsersUpdateResponse update(UsersUpdateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("acs/users/update") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UsersUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersAddToAccessGroupRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersAddToAccessGroupRequest.java new file mode 100644 index 0000000..4709b3c --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersAddToAccessGroupRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersAddToAccessGroupRequest.Builder.class) +public final class UsersAddToAccessGroupRequest { + private final String acsUserId; + + private final String acsAccessGroupId; + + private final Map additionalProperties; + + private UsersAddToAccessGroupRequest( + String acsUserId, String acsAccessGroupId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.acsAccessGroupId = acsAccessGroupId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_access_group_id") + public String getAcsAccessGroupId() { + return acsAccessGroupId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersAddToAccessGroupRequest && equalTo((UsersAddToAccessGroupRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersAddToAccessGroupRequest other) { + return acsUserId.equals(other.acsUserId) && acsAccessGroupId.equals(other.acsAccessGroupId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId, this.acsAccessGroupId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + AcsAccessGroupIdStage acsUserId(String acsUserId); + + Builder from(UsersAddToAccessGroupRequest other); + } + + public interface AcsAccessGroupIdStage { + _FinalStage acsAccessGroupId(String acsAccessGroupId); + } + + public interface _FinalStage { + UsersAddToAccessGroupRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, AcsAccessGroupIdStage, _FinalStage { + private String acsUserId; + + private String acsAccessGroupId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersAddToAccessGroupRequest other) { + acsUserId(other.getAcsUserId()); + acsAccessGroupId(other.getAcsAccessGroupId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public AcsAccessGroupIdStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group_id") + public _FinalStage acsAccessGroupId(String acsAccessGroupId) { + this.acsAccessGroupId = acsAccessGroupId; + return this; + } + + @java.lang.Override + public UsersAddToAccessGroupRequest build() { + return new UsersAddToAccessGroupRequest(acsUserId, acsAccessGroupId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersCreateRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersCreateRequest.java new file mode 100644 index 0000000..401c9ce --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersCreateRequest.java @@ -0,0 +1,334 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.acs.users.types.UsersCreateRequestAccessSchedule; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersCreateRequest.Builder.class) +public final class UsersCreateRequest { + private final String acsSystemId; + + private final Optional> acsAccessGroupIds; + + private final Optional userIdentityId; + + private final Optional accessSchedule; + + private final Optional fullName; + + private final Optional email; + + private final Optional phoneNumber; + + private final Optional emailAddress; + + private final Map additionalProperties; + + private UsersCreateRequest( + String acsSystemId, + Optional> acsAccessGroupIds, + Optional userIdentityId, + Optional accessSchedule, + Optional fullName, + Optional email, + Optional phoneNumber, + Optional emailAddress, + Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.acsAccessGroupIds = acsAccessGroupIds; + this.userIdentityId = userIdentityId; + this.accessSchedule = accessSchedule; + this.fullName = fullName; + this.email = email; + this.phoneNumber = phoneNumber; + this.emailAddress = emailAddress; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("acs_access_group_ids") + public Optional> getAcsAccessGroupIds() { + return acsAccessGroupIds; + } + + @JsonProperty("user_identity_id") + public Optional getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("access_schedule") + public Optional getAccessSchedule() { + return accessSchedule; + } + + @JsonProperty("full_name") + public Optional getFullName() { + return fullName; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersCreateRequest && equalTo((UsersCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersCreateRequest other) { + return acsSystemId.equals(other.acsSystemId) + && acsAccessGroupIds.equals(other.acsAccessGroupIds) + && userIdentityId.equals(other.userIdentityId) + && accessSchedule.equals(other.accessSchedule) + && fullName.equals(other.fullName) + && email.equals(other.email) + && phoneNumber.equals(other.phoneNumber) + && emailAddress.equals(other.emailAddress); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsSystemId, + this.acsAccessGroupIds, + this.userIdentityId, + this.accessSchedule, + this.fullName, + this.email, + this.phoneNumber, + this.emailAddress); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsSystemIdStage builder() { + return new Builder(); + } + + public interface AcsSystemIdStage { + _FinalStage acsSystemId(String acsSystemId); + + Builder from(UsersCreateRequest other); + } + + public interface _FinalStage { + UsersCreateRequest build(); + + _FinalStage acsAccessGroupIds(Optional> acsAccessGroupIds); + + _FinalStage acsAccessGroupIds(List acsAccessGroupIds); + + _FinalStage userIdentityId(Optional userIdentityId); + + _FinalStage userIdentityId(String userIdentityId); + + _FinalStage accessSchedule(Optional accessSchedule); + + _FinalStage accessSchedule(UsersCreateRequestAccessSchedule accessSchedule); + + _FinalStage fullName(Optional fullName); + + _FinalStage fullName(String fullName); + + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + _FinalStage emailAddress(Optional emailAddress); + + _FinalStage emailAddress(String emailAddress); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsSystemIdStage, _FinalStage { + private String acsSystemId; + + private Optional emailAddress = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional fullName = Optional.empty(); + + private Optional accessSchedule = Optional.empty(); + + private Optional userIdentityId = Optional.empty(); + + private Optional> acsAccessGroupIds = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersCreateRequest other) { + acsSystemId(other.getAcsSystemId()); + acsAccessGroupIds(other.getAcsAccessGroupIds()); + userIdentityId(other.getUserIdentityId()); + accessSchedule(other.getAccessSchedule()); + fullName(other.getFullName()); + email(other.getEmail()); + phoneNumber(other.getPhoneNumber()); + emailAddress(other.getEmailAddress()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public _FinalStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + public _FinalStage emailAddress(String emailAddress) { + this.emailAddress = Optional.of(emailAddress); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public _FinalStage emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.of(phoneNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.of(email); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public _FinalStage fullName(String fullName) { + this.fullName = Optional.of(fullName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "full_name", nulls = Nulls.SKIP) + public _FinalStage fullName(Optional fullName) { + this.fullName = fullName; + return this; + } + + @java.lang.Override + public _FinalStage accessSchedule(UsersCreateRequestAccessSchedule accessSchedule) { + this.accessSchedule = Optional.of(accessSchedule); + return this; + } + + @java.lang.Override + @JsonSetter(value = "access_schedule", nulls = Nulls.SKIP) + public _FinalStage accessSchedule(Optional accessSchedule) { + this.accessSchedule = accessSchedule; + return this; + } + + @java.lang.Override + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = Optional.of(userIdentityId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_id", nulls = Nulls.SKIP) + public _FinalStage userIdentityId(Optional userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public _FinalStage acsAccessGroupIds(List acsAccessGroupIds) { + this.acsAccessGroupIds = Optional.of(acsAccessGroupIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_access_group_ids", nulls = Nulls.SKIP) + public _FinalStage acsAccessGroupIds(Optional> acsAccessGroupIds) { + this.acsAccessGroupIds = acsAccessGroupIds; + return this; + } + + @java.lang.Override + public UsersCreateRequest build() { + return new UsersCreateRequest( + acsSystemId, + acsAccessGroupIds, + userIdentityId, + accessSchedule, + fullName, + email, + phoneNumber, + emailAddress, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersDeleteRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersDeleteRequest.java new file mode 100644 index 0000000..5422eee --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersDeleteRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersDeleteRequest.Builder.class) +public final class UsersDeleteRequest { + private final String acsUserId; + + private final Map additionalProperties; + + private UsersDeleteRequest(String acsUserId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersDeleteRequest && equalTo((UsersDeleteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersDeleteRequest other) { + return acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + + Builder from(UsersDeleteRequest other); + } + + public interface _FinalStage { + UsersDeleteRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, _FinalStage { + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersDeleteRequest other) { + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UsersDeleteRequest build() { + return new UsersDeleteRequest(acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersGetRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersGetRequest.java new file mode 100644 index 0000000..95a2d10 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersGetRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersGetRequest.Builder.class) +public final class UsersGetRequest { + private final String acsUserId; + + private final Map additionalProperties; + + private UsersGetRequest(String acsUserId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersGetRequest && equalTo((UsersGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersGetRequest other) { + return acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + + Builder from(UsersGetRequest other); + } + + public interface _FinalStage { + UsersGetRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, _FinalStage { + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersGetRequest other) { + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UsersGetRequest build() { + return new UsersGetRequest(acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersListAccessibleEntrancesRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersListAccessibleEntrancesRequest.java new file mode 100644 index 0000000..8f1bbdd --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersListAccessibleEntrancesRequest.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersListAccessibleEntrancesRequest.Builder.class) +public final class UsersListAccessibleEntrancesRequest { + private final String acsUserId; + + private final Map additionalProperties; + + private UsersListAccessibleEntrancesRequest(String acsUserId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListAccessibleEntrancesRequest + && equalTo((UsersListAccessibleEntrancesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListAccessibleEntrancesRequest other) { + return acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + + Builder from(UsersListAccessibleEntrancesRequest other); + } + + public interface _FinalStage { + UsersListAccessibleEntrancesRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, _FinalStage { + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersListAccessibleEntrancesRequest other) { + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UsersListAccessibleEntrancesRequest build() { + return new UsersListAccessibleEntrancesRequest(acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersListRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersListRequest.java new file mode 100644 index 0000000..522ca38 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersListRequest.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersListRequest.Builder.class) +public final class UsersListRequest { + private final Optional userIdentityId; + + private final Optional userIdentityPhoneNumber; + + private final Optional userIdentityEmailAddress; + + private final Optional acsSystemId; + + private final Map additionalProperties; + + private UsersListRequest( + Optional userIdentityId, + Optional userIdentityPhoneNumber, + Optional userIdentityEmailAddress, + Optional acsSystemId, + Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.userIdentityPhoneNumber = userIdentityPhoneNumber; + this.userIdentityEmailAddress = userIdentityEmailAddress; + this.acsSystemId = acsSystemId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public Optional getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("user_identity_phone_number") + public Optional getUserIdentityPhoneNumber() { + return userIdentityPhoneNumber; + } + + @JsonProperty("user_identity_email_address") + public Optional getUserIdentityEmailAddress() { + return userIdentityEmailAddress; + } + + @JsonProperty("acs_system_id") + public Optional getAcsSystemId() { + return acsSystemId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListRequest && equalTo((UsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListRequest other) { + return userIdentityId.equals(other.userIdentityId) + && userIdentityPhoneNumber.equals(other.userIdentityPhoneNumber) + && userIdentityEmailAddress.equals(other.userIdentityEmailAddress) + && acsSystemId.equals(other.acsSystemId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userIdentityId, this.userIdentityPhoneNumber, this.userIdentityEmailAddress, this.acsSystemId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userIdentityId = Optional.empty(); + + private Optional userIdentityPhoneNumber = Optional.empty(); + + private Optional userIdentityEmailAddress = Optional.empty(); + + private Optional acsSystemId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersListRequest other) { + userIdentityId(other.getUserIdentityId()); + userIdentityPhoneNumber(other.getUserIdentityPhoneNumber()); + userIdentityEmailAddress(other.getUserIdentityEmailAddress()); + acsSystemId(other.getAcsSystemId()); + return this; + } + + @JsonSetter(value = "user_identity_id", nulls = Nulls.SKIP) + public Builder userIdentityId(Optional userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + public Builder userIdentityId(String userIdentityId) { + this.userIdentityId = Optional.of(userIdentityId); + return this; + } + + @JsonSetter(value = "user_identity_phone_number", nulls = Nulls.SKIP) + public Builder userIdentityPhoneNumber(Optional userIdentityPhoneNumber) { + this.userIdentityPhoneNumber = userIdentityPhoneNumber; + return this; + } + + public Builder userIdentityPhoneNumber(String userIdentityPhoneNumber) { + this.userIdentityPhoneNumber = Optional.of(userIdentityPhoneNumber); + return this; + } + + @JsonSetter(value = "user_identity_email_address", nulls = Nulls.SKIP) + public Builder userIdentityEmailAddress(Optional userIdentityEmailAddress) { + this.userIdentityEmailAddress = userIdentityEmailAddress; + return this; + } + + public Builder userIdentityEmailAddress(String userIdentityEmailAddress) { + this.userIdentityEmailAddress = Optional.of(userIdentityEmailAddress); + return this; + } + + @JsonSetter(value = "acs_system_id", nulls = Nulls.SKIP) + public Builder acsSystemId(Optional acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + public Builder acsSystemId(String acsSystemId) { + this.acsSystemId = Optional.of(acsSystemId); + return this; + } + + public UsersListRequest build() { + return new UsersListRequest( + userIdentityId, + userIdentityPhoneNumber, + userIdentityEmailAddress, + acsSystemId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersRemoveFromAccessGroupRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersRemoveFromAccessGroupRequest.java new file mode 100644 index 0000000..79abe3c --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersRemoveFromAccessGroupRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersRemoveFromAccessGroupRequest.Builder.class) +public final class UsersRemoveFromAccessGroupRequest { + private final String acsUserId; + + private final String acsAccessGroupId; + + private final Map additionalProperties; + + private UsersRemoveFromAccessGroupRequest( + String acsUserId, String acsAccessGroupId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.acsAccessGroupId = acsAccessGroupId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_access_group_id") + public String getAcsAccessGroupId() { + return acsAccessGroupId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRemoveFromAccessGroupRequest && equalTo((UsersRemoveFromAccessGroupRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRemoveFromAccessGroupRequest other) { + return acsUserId.equals(other.acsUserId) && acsAccessGroupId.equals(other.acsAccessGroupId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId, this.acsAccessGroupId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + AcsAccessGroupIdStage acsUserId(String acsUserId); + + Builder from(UsersRemoveFromAccessGroupRequest other); + } + + public interface AcsAccessGroupIdStage { + _FinalStage acsAccessGroupId(String acsAccessGroupId); + } + + public interface _FinalStage { + UsersRemoveFromAccessGroupRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, AcsAccessGroupIdStage, _FinalStage { + private String acsUserId; + + private String acsAccessGroupId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersRemoveFromAccessGroupRequest other) { + acsUserId(other.getAcsUserId()); + acsAccessGroupId(other.getAcsAccessGroupId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public AcsAccessGroupIdStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group_id") + public _FinalStage acsAccessGroupId(String acsAccessGroupId) { + this.acsAccessGroupId = acsAccessGroupId; + return this; + } + + @java.lang.Override + public UsersRemoveFromAccessGroupRequest build() { + return new UsersRemoveFromAccessGroupRequest(acsUserId, acsAccessGroupId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersRevokeAccessToAllEntrancesRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersRevokeAccessToAllEntrancesRequest.java new file mode 100644 index 0000000..ab041cd --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersRevokeAccessToAllEntrancesRequest.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersRevokeAccessToAllEntrancesRequest.Builder.class) +public final class UsersRevokeAccessToAllEntrancesRequest { + private final String acsUserId; + + private final Map additionalProperties; + + private UsersRevokeAccessToAllEntrancesRequest(String acsUserId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRevokeAccessToAllEntrancesRequest + && equalTo((UsersRevokeAccessToAllEntrancesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRevokeAccessToAllEntrancesRequest other) { + return acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + + Builder from(UsersRevokeAccessToAllEntrancesRequest other); + } + + public interface _FinalStage { + UsersRevokeAccessToAllEntrancesRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, _FinalStage { + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersRevokeAccessToAllEntrancesRequest other) { + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UsersRevokeAccessToAllEntrancesRequest build() { + return new UsersRevokeAccessToAllEntrancesRequest(acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersSuspendRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersSuspendRequest.java new file mode 100644 index 0000000..4c6c78b --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersSuspendRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersSuspendRequest.Builder.class) +public final class UsersSuspendRequest { + private final String acsUserId; + + private final Map additionalProperties; + + private UsersSuspendRequest(String acsUserId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersSuspendRequest && equalTo((UsersSuspendRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersSuspendRequest other) { + return acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + + Builder from(UsersSuspendRequest other); + } + + public interface _FinalStage { + UsersSuspendRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, _FinalStage { + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersSuspendRequest other) { + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UsersSuspendRequest build() { + return new UsersSuspendRequest(acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersUnsuspendRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersUnsuspendRequest.java new file mode 100644 index 0000000..d7e59d2 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersUnsuspendRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersUnsuspendRequest.Builder.class) +public final class UsersUnsuspendRequest { + private final String acsUserId; + + private final Map additionalProperties; + + private UsersUnsuspendRequest(String acsUserId, Map additionalProperties) { + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersUnsuspendRequest && equalTo((UsersUnsuspendRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersUnsuspendRequest other) { + return acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + + Builder from(UsersUnsuspendRequest other); + } + + public interface _FinalStage { + UsersUnsuspendRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, _FinalStage { + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersUnsuspendRequest other) { + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UsersUnsuspendRequest build() { + return new UsersUnsuspendRequest(acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/requests/UsersUpdateRequest.java b/src/main/java/com/seam/api/resources/acs/users/requests/UsersUpdateRequest.java new file mode 100644 index 0000000..5d911b8 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/requests/UsersUpdateRequest.java @@ -0,0 +1,301 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.acs.users.types.UsersUpdateRequestAccessSchedule; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersUpdateRequest.Builder.class) +public final class UsersUpdateRequest { + private final Optional accessSchedule; + + private final String acsUserId; + + private final Optional fullName; + + private final Optional email; + + private final Optional phoneNumber; + + private final Optional emailAddress; + + private final Optional hidAcsSystemId; + + private final Map additionalProperties; + + private UsersUpdateRequest( + Optional accessSchedule, + String acsUserId, + Optional fullName, + Optional email, + Optional phoneNumber, + Optional emailAddress, + Optional hidAcsSystemId, + Map additionalProperties) { + this.accessSchedule = accessSchedule; + this.acsUserId = acsUserId; + this.fullName = fullName; + this.email = email; + this.phoneNumber = phoneNumber; + this.emailAddress = emailAddress; + this.hidAcsSystemId = hidAcsSystemId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("access_schedule") + public Optional getAccessSchedule() { + return accessSchedule; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @JsonProperty("full_name") + public Optional getFullName() { + return fullName; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + @JsonProperty("hid_acs_system_id") + public Optional getHidAcsSystemId() { + return hidAcsSystemId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersUpdateRequest && equalTo((UsersUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersUpdateRequest other) { + return accessSchedule.equals(other.accessSchedule) + && acsUserId.equals(other.acsUserId) + && fullName.equals(other.fullName) + && email.equals(other.email) + && phoneNumber.equals(other.phoneNumber) + && emailAddress.equals(other.emailAddress) + && hidAcsSystemId.equals(other.hidAcsSystemId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accessSchedule, + this.acsUserId, + this.fullName, + this.email, + this.phoneNumber, + this.emailAddress, + this.hidAcsSystemId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + + Builder from(UsersUpdateRequest other); + } + + public interface _FinalStage { + UsersUpdateRequest build(); + + _FinalStage accessSchedule(Optional accessSchedule); + + _FinalStage accessSchedule(UsersUpdateRequestAccessSchedule accessSchedule); + + _FinalStage fullName(Optional fullName); + + _FinalStage fullName(String fullName); + + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + _FinalStage emailAddress(Optional emailAddress); + + _FinalStage emailAddress(String emailAddress); + + _FinalStage hidAcsSystemId(Optional hidAcsSystemId); + + _FinalStage hidAcsSystemId(String hidAcsSystemId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserIdStage, _FinalStage { + private String acsUserId; + + private Optional hidAcsSystemId = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional fullName = Optional.empty(); + + private Optional accessSchedule = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersUpdateRequest other) { + accessSchedule(other.getAccessSchedule()); + acsUserId(other.getAcsUserId()); + fullName(other.getFullName()); + email(other.getEmail()); + phoneNumber(other.getPhoneNumber()); + emailAddress(other.getEmailAddress()); + hidAcsSystemId(other.getHidAcsSystemId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public _FinalStage hidAcsSystemId(String hidAcsSystemId) { + this.hidAcsSystemId = Optional.of(hidAcsSystemId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hid_acs_system_id", nulls = Nulls.SKIP) + public _FinalStage hidAcsSystemId(Optional hidAcsSystemId) { + this.hidAcsSystemId = hidAcsSystemId; + return this; + } + + @java.lang.Override + public _FinalStage emailAddress(String emailAddress) { + this.emailAddress = Optional.of(emailAddress); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public _FinalStage emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.of(phoneNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.of(email); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public _FinalStage fullName(String fullName) { + this.fullName = Optional.of(fullName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "full_name", nulls = Nulls.SKIP) + public _FinalStage fullName(Optional fullName) { + this.fullName = fullName; + return this; + } + + @java.lang.Override + public _FinalStage accessSchedule(UsersUpdateRequestAccessSchedule accessSchedule) { + this.accessSchedule = Optional.of(accessSchedule); + return this; + } + + @java.lang.Override + @JsonSetter(value = "access_schedule", nulls = Nulls.SKIP) + public _FinalStage accessSchedule(Optional accessSchedule) { + this.accessSchedule = accessSchedule; + return this; + } + + @java.lang.Override + public UsersUpdateRequest build() { + return new UsersUpdateRequest( + accessSchedule, + acsUserId, + fullName, + email, + phoneNumber, + emailAddress, + hidAcsSystemId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ThermostatsSetFanModeResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersAddToAccessGroupResponse.java similarity index 70% rename from src/main/java/com/seam/api/types/ThermostatsSetFanModeResponse.java rename to src/main/java/com/seam/api/resources/acs/users/types/UsersAddToAccessGroupResponse.java index 4052034..e29decf 100644 --- a/src/main/java/com/seam/api/types/ThermostatsSetFanModeResponse.java +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersAddToAccessGroupResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.acs.users.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -16,13 +16,13 @@ import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ThermostatsSetFanModeResponse.Builder.class) -public final class ThermostatsSetFanModeResponse { +@JsonDeserialize(builder = UsersAddToAccessGroupResponse.Builder.class) +public final class UsersAddToAccessGroupResponse { private final boolean ok; private final Map additionalProperties; - private ThermostatsSetFanModeResponse(boolean ok, Map additionalProperties) { + private UsersAddToAccessGroupResponse(boolean ok, Map additionalProperties) { this.ok = ok; this.additionalProperties = additionalProperties; } @@ -32,10 +32,10 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ThermostatsSetFanModeResponse && equalTo((ThermostatsSetFanModeResponse) other); + return other instanceof UsersAddToAccessGroupResponse && equalTo((UsersAddToAccessGroupResponse) other); } @JsonAnyGetter @@ -43,16 +43,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ThermostatsSetFanModeResponse other) { + private boolean equalTo(UsersAddToAccessGroupResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -64,11 +64,11 @@ public static OkStage builder() { public interface OkStage { _FinalStage ok(boolean ok); - Builder from(ThermostatsSetFanModeResponse other); + Builder from(UsersAddToAccessGroupResponse other); } public interface _FinalStage { - ThermostatsSetFanModeResponse build(); + UsersAddToAccessGroupResponse build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -80,22 +80,22 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override - public Builder from(ThermostatsSetFanModeResponse other) { + @java.lang.Override + public Builder from(UsersAddToAccessGroupResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override - public ThermostatsSetFanModeResponse build() { - return new ThermostatsSetFanModeResponse(ok, additionalProperties); + @java.lang.Override + public UsersAddToAccessGroupResponse build() { + return new UsersAddToAccessGroupResponse(ok, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersCreateRequestAccessSchedule.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersCreateRequestAccessSchedule.java new file mode 100644 index 0000000..d1d10ff --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersCreateRequestAccessSchedule.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersCreateRequestAccessSchedule.Builder.class) +public final class UsersCreateRequestAccessSchedule { + private final OffsetDateTime startsAt; + + private final OffsetDateTime endsAt; + + private final Map additionalProperties; + + private UsersCreateRequestAccessSchedule( + OffsetDateTime startsAt, OffsetDateTime endsAt, Map additionalProperties) { + this.startsAt = startsAt; + this.endsAt = endsAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("starts_at") + public OffsetDateTime getStartsAt() { + return startsAt; + } + + @JsonProperty("ends_at") + public OffsetDateTime getEndsAt() { + return endsAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersCreateRequestAccessSchedule && equalTo((UsersCreateRequestAccessSchedule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersCreateRequestAccessSchedule other) { + return startsAt.equals(other.startsAt) && endsAt.equals(other.endsAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.startsAt, this.endsAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StartsAtStage builder() { + return new Builder(); + } + + public interface StartsAtStage { + EndsAtStage startsAt(OffsetDateTime startsAt); + + Builder from(UsersCreateRequestAccessSchedule other); + } + + public interface EndsAtStage { + _FinalStage endsAt(OffsetDateTime endsAt); + } + + public interface _FinalStage { + UsersCreateRequestAccessSchedule build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StartsAtStage, EndsAtStage, _FinalStage { + private OffsetDateTime startsAt; + + private OffsetDateTime endsAt; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersCreateRequestAccessSchedule other) { + startsAt(other.getStartsAt()); + endsAt(other.getEndsAt()); + return this; + } + + @java.lang.Override + @JsonSetter("starts_at") + public EndsAtStage startsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + return this; + } + + @java.lang.Override + @JsonSetter("ends_at") + public _FinalStage endsAt(OffsetDateTime endsAt) { + this.endsAt = endsAt; + return this; + } + + @java.lang.Override + public UsersCreateRequestAccessSchedule build() { + return new UsersCreateRequestAccessSchedule(startsAt, endsAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersCreateResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersCreateResponse.java new file mode 100644 index 0000000..bd393fa --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersCreateResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsUser; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersCreateResponse.Builder.class) +public final class UsersCreateResponse { + private final AcsUser acsUser; + + private final boolean ok; + + private final Map additionalProperties; + + private UsersCreateResponse(AcsUser acsUser, boolean ok, Map additionalProperties) { + this.acsUser = acsUser; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user") + public AcsUser getAcsUser() { + return acsUser; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersCreateResponse && equalTo((UsersCreateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersCreateResponse other) { + return acsUser.equals(other.acsUser) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUser, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserStage builder() { + return new Builder(); + } + + public interface AcsUserStage { + OkStage acsUser(AcsUser acsUser); + + Builder from(UsersCreateResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + UsersCreateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserStage, OkStage, _FinalStage { + private AcsUser acsUser; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersCreateResponse other) { + acsUser(other.getAcsUser()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user") + public OkStage acsUser(AcsUser acsUser) { + this.acsUser = acsUser; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersCreateResponse build() { + return new UsersCreateResponse(acsUser, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersDeleteResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersDeleteResponse.java new file mode 100644 index 0000000..d2edc56 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersDeleteResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersDeleteResponse.Builder.class) +public final class UsersDeleteResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UsersDeleteResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersDeleteResponse && equalTo((UsersDeleteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersDeleteResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersDeleteResponse other); + } + + public interface _FinalStage { + UsersDeleteResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersDeleteResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersDeleteResponse build() { + return new UsersDeleteResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersGetResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersGetResponse.java new file mode 100644 index 0000000..1180bc2 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersGetResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsUser; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersGetResponse.Builder.class) +public final class UsersGetResponse { + private final AcsUser acsUser; + + private final boolean ok; + + private final Map additionalProperties; + + private UsersGetResponse(AcsUser acsUser, boolean ok, Map additionalProperties) { + this.acsUser = acsUser; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user") + public AcsUser getAcsUser() { + return acsUser; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersGetResponse && equalTo((UsersGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersGetResponse other) { + return acsUser.equals(other.acsUser) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUser, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserStage builder() { + return new Builder(); + } + + public interface AcsUserStage { + OkStage acsUser(AcsUser acsUser); + + Builder from(UsersGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + UsersGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AcsUserStage, OkStage, _FinalStage { + private AcsUser acsUser; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersGetResponse other) { + acsUser(other.getAcsUser()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user") + public OkStage acsUser(AcsUser acsUser) { + this.acsUser = acsUser; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersGetResponse build() { + return new UsersGetResponse(acsUser, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersListAccessibleEntrancesResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersListAccessibleEntrancesResponse.java new file mode 100644 index 0000000..4fd054f --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersListAccessibleEntrancesResponse.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsEntrance; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersListAccessibleEntrancesResponse.Builder.class) +public final class UsersListAccessibleEntrancesResponse { + private final List acsEntrances; + + private final boolean ok; + + private final Map additionalProperties; + + private UsersListAccessibleEntrancesResponse( + List acsEntrances, boolean ok, Map additionalProperties) { + this.acsEntrances = acsEntrances; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_entrances") + public List getAcsEntrances() { + return acsEntrances; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListAccessibleEntrancesResponse + && equalTo((UsersListAccessibleEntrancesResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListAccessibleEntrancesResponse other) { + return acsEntrances.equals(other.acsEntrances) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsEntrances, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersListAccessibleEntrancesResponse other); + } + + public interface _FinalStage { + UsersListAccessibleEntrancesResponse build(); + + _FinalStage acsEntrances(List acsEntrances); + + _FinalStage addAcsEntrances(AcsEntrance acsEntrances); + + _FinalStage addAllAcsEntrances(List acsEntrances); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsEntrances = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersListAccessibleEntrancesResponse other) { + acsEntrances(other.getAcsEntrances()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsEntrances(List acsEntrances) { + this.acsEntrances.addAll(acsEntrances); + return this; + } + + @java.lang.Override + public _FinalStage addAcsEntrances(AcsEntrance acsEntrances) { + this.acsEntrances.add(acsEntrances); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_entrances", nulls = Nulls.SKIP) + public _FinalStage acsEntrances(List acsEntrances) { + this.acsEntrances.clear(); + this.acsEntrances.addAll(acsEntrances); + return this; + } + + @java.lang.Override + public UsersListAccessibleEntrancesResponse build() { + return new UsersListAccessibleEntrancesResponse(acsEntrances, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersListResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersListResponse.java new file mode 100644 index 0000000..a4ab304 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersListResponse.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsUser; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersListResponse.Builder.class) +public final class UsersListResponse { + private final List acsUsers; + + private final boolean ok; + + private final Map additionalProperties; + + private UsersListResponse(List acsUsers, boolean ok, Map additionalProperties) { + this.acsUsers = acsUsers; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_users") + public List getAcsUsers() { + return acsUsers; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListResponse && equalTo((UsersListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListResponse other) { + return acsUsers.equals(other.acsUsers) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUsers, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersListResponse other); + } + + public interface _FinalStage { + UsersListResponse build(); + + _FinalStage acsUsers(List acsUsers); + + _FinalStage addAcsUsers(AcsUser acsUsers); + + _FinalStage addAllAcsUsers(List acsUsers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsUsers = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersListResponse other) { + acsUsers(other.getAcsUsers()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsUsers(List acsUsers) { + this.acsUsers.addAll(acsUsers); + return this; + } + + @java.lang.Override + public _FinalStage addAcsUsers(AcsUser acsUsers) { + this.acsUsers.add(acsUsers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_users", nulls = Nulls.SKIP) + public _FinalStage acsUsers(List acsUsers) { + this.acsUsers.clear(); + this.acsUsers.addAll(acsUsers); + return this; + } + + @java.lang.Override + public UsersListResponse build() { + return new UsersListResponse(acsUsers, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersRemoveFromAccessGroupResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersRemoveFromAccessGroupResponse.java new file mode 100644 index 0000000..24e5ed1 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersRemoveFromAccessGroupResponse.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersRemoveFromAccessGroupResponse.Builder.class) +public final class UsersRemoveFromAccessGroupResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UsersRemoveFromAccessGroupResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRemoveFromAccessGroupResponse + && equalTo((UsersRemoveFromAccessGroupResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRemoveFromAccessGroupResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersRemoveFromAccessGroupResponse other); + } + + public interface _FinalStage { + UsersRemoveFromAccessGroupResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersRemoveFromAccessGroupResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersRemoveFromAccessGroupResponse build() { + return new UsersRemoveFromAccessGroupResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersRevokeAccessToAllEntrancesResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersRevokeAccessToAllEntrancesResponse.java new file mode 100644 index 0000000..3417579 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersRevokeAccessToAllEntrancesResponse.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersRevokeAccessToAllEntrancesResponse.Builder.class) +public final class UsersRevokeAccessToAllEntrancesResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UsersRevokeAccessToAllEntrancesResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRevokeAccessToAllEntrancesResponse + && equalTo((UsersRevokeAccessToAllEntrancesResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRevokeAccessToAllEntrancesResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersRevokeAccessToAllEntrancesResponse other); + } + + public interface _FinalStage { + UsersRevokeAccessToAllEntrancesResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersRevokeAccessToAllEntrancesResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersRevokeAccessToAllEntrancesResponse build() { + return new UsersRevokeAccessToAllEntrancesResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersSuspendResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersSuspendResponse.java new file mode 100644 index 0000000..5ba7128 --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersSuspendResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersSuspendResponse.Builder.class) +public final class UsersSuspendResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UsersSuspendResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersSuspendResponse && equalTo((UsersSuspendResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersSuspendResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersSuspendResponse other); + } + + public interface _FinalStage { + UsersSuspendResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersSuspendResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersSuspendResponse build() { + return new UsersSuspendResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersUnsuspendResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersUnsuspendResponse.java new file mode 100644 index 0000000..4281eac --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersUnsuspendResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersUnsuspendResponse.Builder.class) +public final class UsersUnsuspendResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UsersUnsuspendResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersUnsuspendResponse && equalTo((UsersUnsuspendResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersUnsuspendResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersUnsuspendResponse other); + } + + public interface _FinalStage { + UsersUnsuspendResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersUnsuspendResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersUnsuspendResponse build() { + return new UsersUnsuspendResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateRequestAccessSchedule.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateRequestAccessSchedule.java new file mode 100644 index 0000000..6accb9e --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateRequestAccessSchedule.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersUpdateRequestAccessSchedule.Builder.class) +public final class UsersUpdateRequestAccessSchedule { + private final OffsetDateTime startsAt; + + private final OffsetDateTime endsAt; + + private final Map additionalProperties; + + private UsersUpdateRequestAccessSchedule( + OffsetDateTime startsAt, OffsetDateTime endsAt, Map additionalProperties) { + this.startsAt = startsAt; + this.endsAt = endsAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("starts_at") + public OffsetDateTime getStartsAt() { + return startsAt; + } + + @JsonProperty("ends_at") + public OffsetDateTime getEndsAt() { + return endsAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersUpdateRequestAccessSchedule && equalTo((UsersUpdateRequestAccessSchedule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersUpdateRequestAccessSchedule other) { + return startsAt.equals(other.startsAt) && endsAt.equals(other.endsAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.startsAt, this.endsAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StartsAtStage builder() { + return new Builder(); + } + + public interface StartsAtStage { + EndsAtStage startsAt(OffsetDateTime startsAt); + + Builder from(UsersUpdateRequestAccessSchedule other); + } + + public interface EndsAtStage { + _FinalStage endsAt(OffsetDateTime endsAt); + } + + public interface _FinalStage { + UsersUpdateRequestAccessSchedule build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StartsAtStage, EndsAtStage, _FinalStage { + private OffsetDateTime startsAt; + + private OffsetDateTime endsAt; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersUpdateRequestAccessSchedule other) { + startsAt(other.getStartsAt()); + endsAt(other.getEndsAt()); + return this; + } + + @java.lang.Override + @JsonSetter("starts_at") + public EndsAtStage startsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + return this; + } + + @java.lang.Override + @JsonSetter("ends_at") + public _FinalStage endsAt(OffsetDateTime endsAt) { + this.endsAt = endsAt; + return this; + } + + @java.lang.Override + public UsersUpdateRequestAccessSchedule build() { + return new UsersUpdateRequestAccessSchedule(startsAt, endsAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateResponse.java b/src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateResponse.java new file mode 100644 index 0000000..0d2c6df --- /dev/null +++ b/src/main/java/com/seam/api/resources/acs/users/types/UsersUpdateResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.acs.users.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UsersUpdateResponse.Builder.class) +public final class UsersUpdateResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UsersUpdateResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersUpdateResponse && equalTo((UsersUpdateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersUpdateResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UsersUpdateResponse other); + } + + public interface _FinalStage { + UsersUpdateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersUpdateResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UsersUpdateResponse build() { + return new UsersUpdateResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/actionattempts/ActionAttemptsClient.java b/src/main/java/com/seam/api/resources/actionattempts/ActionAttemptsClient.java index f942ba6..d1a51cc 100644 --- a/src/main/java/com/seam/api/resources/actionattempts/ActionAttemptsClient.java +++ b/src/main/java/com/seam/api/resources/actionattempts/ActionAttemptsClient.java @@ -3,23 +3,29 @@ */ package com.seam.api.resources.actionattempts; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.actionattempts.requests.ActionAttemptsGetRequest; import com.seam.api.resources.actionattempts.requests.ActionAttemptsListRequest; +import com.seam.api.resources.actionattempts.types.ActionAttemptsGetResponse; +import com.seam.api.resources.actionattempts.types.ActionAttemptsListResponse; import com.seam.api.types.ActionAttempt; -import com.seam.api.types.ActionAttemptsGetResponse; -import com.seam.api.types.ActionAttemptsListResponse; import java.io.IOException; import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class ActionAttemptsClient { protected final ClientOptions clientOptions; @@ -28,12 +34,6 @@ public ActionAttemptsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public ActionAttempt getById(String actionAttemptId) { - return get(ActionAttemptsGetRequest.builder() - .actionAttemptId(actionAttemptId) - .build()); - } - public ActionAttempt get(ActionAttemptsGetRequest request) { return get(request, null); } @@ -46,9 +46,9 @@ public ActionAttempt get(ActionAttemptsGetRequest request, RequestOptions reques RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -56,19 +56,36 @@ public ActionAttempt get(ActionAttemptsGetRequest request, RequestOptions reques .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { ActionAttemptsGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ActionAttemptsGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ActionAttemptsGetResponse.class); return parsedResponse.getActionAttempt(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -84,9 +101,9 @@ public List list(ActionAttemptsListRequest request, RequestOption RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -94,19 +111,36 @@ public List list(ActionAttemptsListRequest request, RequestOption .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { ActionAttemptsListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ActionAttemptsListResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ActionAttemptsListResponse.class); return parsedResponse.getActionAttempts(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsGetRequest.java b/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsGetRequest.java index d4d5fb3..3effb2a 100644 --- a/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsGetRequest.java +++ b/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsGetRequest.java @@ -32,7 +32,7 @@ public String getActionAttemptId() { return actionAttemptId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionAttemptsGetRequest && equalTo((ActionAttemptsGetRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(ActionAttemptsGetRequest other) { return actionAttemptId.equals(other.actionAttemptId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttemptId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements ActionAttemptIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ActionAttemptsGetRequest other) { actionAttemptId(other.getActionAttemptId()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt_id") public _FinalStage actionAttemptId(String actionAttemptId) { this.actionAttemptId = actionAttemptId; return this; } - @Override + @java.lang.Override public ActionAttemptsGetRequest build() { return new ActionAttemptsGetRequest(actionAttemptId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsListRequest.java b/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsListRequest.java index 5a057d0..036e6ac 100644 --- a/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsListRequest.java +++ b/src/main/java/com/seam/api/resources/actionattempts/requests/ActionAttemptsListRequest.java @@ -35,7 +35,7 @@ public List getActionAttemptIds() { return actionAttemptIds; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionAttemptsListRequest && equalTo((ActionAttemptsListRequest) other); @@ -50,12 +50,12 @@ private boolean equalTo(ActionAttemptsListRequest other) { return actionAttemptIds.equals(other.actionAttemptIds); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttemptIds); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/types/ActionAttemptsGetResponse.java b/src/main/java/com/seam/api/resources/actionattempts/types/ActionAttemptsGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ActionAttemptsGetResponse.java rename to src/main/java/com/seam/api/resources/actionattempts/types/ActionAttemptsGetResponse.java index 3f8544b..4c34249 100644 --- a/src/main/java/com/seam/api/types/ActionAttemptsGetResponse.java +++ b/src/main/java/com/seam/api/resources/actionattempts/types/ActionAttemptsGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.actionattempts.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionAttemptsGetResponse && equalTo((ActionAttemptsGetResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(ActionAttemptsGetResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(ActionAttemptsGetResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ActionAttemptsGetResponse build() { return new ActionAttemptsGetResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ActionAttemptsListResponse.java b/src/main/java/com/seam/api/resources/actionattempts/types/ActionAttemptsListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ActionAttemptsListResponse.java rename to src/main/java/com/seam/api/resources/actionattempts/types/ActionAttemptsListResponse.java index dbe8fdb..1395909 100644 --- a/src/main/java/com/seam/api/types/ActionAttemptsListResponse.java +++ b/src/main/java/com/seam/api/resources/actionattempts/types/ActionAttemptsListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.actionattempts.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ActionAttemptsListResponse && equalTo((ActionAttemptsListResponse) other); @@ -59,12 +60,12 @@ private boolean equalTo(ActionAttemptsListResponse other) { return actionAttempts.equals(other.actionAttempts) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempts, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,33 +101,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ActionAttemptsListResponse other) { actionAttempts(other.getActionAttempts()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllActionAttempts(List actionAttempts) { this.actionAttempts.addAll(actionAttempts); return this; } - @Override + @java.lang.Override public _FinalStage addActionAttempts(ActionAttempt actionAttempts) { this.actionAttempts.add(actionAttempts); return this; } - @Override + @java.lang.Override @JsonSetter(value = "action_attempts", nulls = Nulls.SKIP) public _FinalStage actionAttempts(List actionAttempts) { this.actionAttempts.clear(); @@ -134,7 +135,7 @@ public _FinalStage actionAttempts(List actionAttempts) { return this; } - @Override + @java.lang.Override public ActionAttemptsListResponse build() { return new ActionAttemptsListResponse(actionAttempts, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/clientsessions/ClientSessionsClient.java b/src/main/java/com/seam/api/resources/clientsessions/ClientSessionsClient.java index 7ade81d..e9a66d3 100644 --- a/src/main/java/com/seam/api/resources/clientsessions/ClientSessionsClient.java +++ b/src/main/java/com/seam/api/resources/clientsessions/ClientSessionsClient.java @@ -3,27 +3,39 @@ */ package com.seam.api.resources.clientsessions; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.clientsessions.requests.ClientSessionsCreateRequest; import com.seam.api.resources.clientsessions.requests.ClientSessionsDeleteRequest; +import com.seam.api.resources.clientsessions.requests.ClientSessionsGetOrCreateRequest; import com.seam.api.resources.clientsessions.requests.ClientSessionsGetRequest; +import com.seam.api.resources.clientsessions.requests.ClientSessionsGrantAccessRequest; import com.seam.api.resources.clientsessions.requests.ClientSessionsListRequest; +import com.seam.api.resources.clientsessions.requests.ClientSessionsRevokeRequest; +import com.seam.api.resources.clientsessions.types.ClientSessionsCreateResponse; +import com.seam.api.resources.clientsessions.types.ClientSessionsDeleteResponse; +import com.seam.api.resources.clientsessions.types.ClientSessionsGetOrCreateResponse; +import com.seam.api.resources.clientsessions.types.ClientSessionsGetResponse; +import com.seam.api.resources.clientsessions.types.ClientSessionsGrantAccessResponse; +import com.seam.api.resources.clientsessions.types.ClientSessionsListResponse; +import com.seam.api.resources.clientsessions.types.ClientSessionsRevokeResponse; import com.seam.api.types.ClientSession; -import com.seam.api.types.ClientSessionsCreateResponse; -import com.seam.api.types.ClientSessionsDeleteResponse; -import com.seam.api.types.ClientSessionsGetResponse; -import com.seam.api.types.ClientSessionsListResponse; import java.io.IOException; import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class ClientSessionsClient { protected final ClientOptions clientOptions; @@ -32,6 +44,10 @@ public ClientSessionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + public ClientSession create() { + return create(ClientSessionsCreateRequest.builder().build()); + } + public ClientSession create(ClientSessionsCreateRequest request) { return create(request, null); } @@ -44,9 +60,9 @@ public ClientSession create(ClientSessionsCreateRequest request, RequestOptions RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -54,31 +70,44 @@ public ClientSession create(ClientSessionsCreateRequest request, RequestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ClientSessionsCreateResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ClientSessionsCreateResponse.class); + ClientSessionsCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ClientSessionsCreateResponse.class); return parsedResponse.getClientSession(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ClientSession create() { - return create(ClientSessionsCreateRequest.builder().build()); - } - - public void delete(ClientSessionsDeleteRequest request) { - delete(request, null); + public ClientSessionsDeleteResponse delete(ClientSessionsDeleteRequest request) { + return delete(request, null); } - public void delete(ClientSessionsDeleteRequest request, RequestOptions requestOptions) { + public ClientSessionsDeleteResponse delete(ClientSessionsDeleteRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("client_sessions/delete") @@ -86,9 +115,9 @@ public void delete(ClientSessionsDeleteRequest request, RequestOptions requestOp RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -96,25 +125,39 @@ public void delete(ClientSessionsDeleteRequest request, RequestOptions requestOp .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ClientSessionsDeleteResponse.class); - return; + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ClientSessionsDeleteResponse.class); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ClientSession getById(String clientSessionId) { - return get(ClientSessionsGetRequest.builder() - .clientSessionId(clientSessionId) - .build()); + public ClientSession get() { + return get(ClientSessionsGetRequest.builder().build()); } public ClientSession get(ClientSessionsGetRequest request) { @@ -129,9 +172,9 @@ public ClientSession get(ClientSessionsGetRequest request, RequestOptions reques RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -139,24 +182,159 @@ public ClientSession get(ClientSessionsGetRequest request, RequestOptions reques .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { ClientSessionsGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ClientSessionsGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ClientSessionsGetResponse.class); return parsedResponse.getClientSession(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ClientSession get() { - return get(ClientSessionsGetRequest.builder().build()); + public ClientSession getOrCreate() { + return getOrCreate(ClientSessionsGetOrCreateRequest.builder().build()); + } + + public ClientSession getOrCreate(ClientSessionsGetOrCreateRequest request) { + return getOrCreate(request, null); + } + + public ClientSession getOrCreate(ClientSessionsGetOrCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client_sessions/get_or_create") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + ClientSessionsGetOrCreateResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ClientSessionsGetOrCreateResponse.class); + return parsedResponse.getClientSession(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public ClientSessionsGrantAccessResponse grantAccess() { + return grantAccess(ClientSessionsGrantAccessRequest.builder().build()); + } + + public ClientSessionsGrantAccessResponse grantAccess(ClientSessionsGrantAccessRequest request) { + return grantAccess(request, null); + } + + public ClientSessionsGrantAccessResponse grantAccess( + ClientSessionsGrantAccessRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client_sessions/grant_access") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ClientSessionsGrantAccessResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(ClientSessionsListRequest.builder().build()); } public List list(ClientSessionsListRequest request) { @@ -171,9 +349,9 @@ public List list(ClientSessionsListRequest request, RequestOption RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -181,23 +359,89 @@ public List list(ClientSessionsListRequest request, RequestOption .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { ClientSessionsListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ClientSessionsListResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ClientSessionsListResponse.class); return parsedResponse.getClientSessions(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public List list() { - return list(ClientSessionsListRequest.builder().build()); + public ClientSessionsRevokeResponse revoke(ClientSessionsRevokeRequest request) { + return revoke(request, null); + } + + public ClientSessionsRevokeResponse revoke(ClientSessionsRevokeRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("client_sessions/revoke") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ClientSessionsRevokeResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } } } diff --git a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsCreateRequest.java b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsCreateRequest.java index 03dc50f..3fad89c 100644 --- a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsCreateRequest.java +++ b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsCreateRequest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -27,16 +28,24 @@ public final class ClientSessionsCreateRequest { private final Optional> connectedAccountIds; + private final Optional> userIdentityIds; + + private final Optional expiresAt; + private final Map additionalProperties; private ClientSessionsCreateRequest( Optional userIdentifierKey, Optional> connectWebviewIds, Optional> connectedAccountIds, + Optional> userIdentityIds, + Optional expiresAt, Map additionalProperties) { this.userIdentifierKey = userIdentifierKey; this.connectWebviewIds = connectWebviewIds; this.connectedAccountIds = connectedAccountIds; + this.userIdentityIds = userIdentityIds; + this.expiresAt = expiresAt; this.additionalProperties = additionalProperties; } @@ -55,7 +64,17 @@ public Optional> getConnectedAccountIds() { return connectedAccountIds; } - @Override + @JsonProperty("user_identity_ids") + public Optional> getUserIdentityIds() { + return userIdentityIds; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsCreateRequest && equalTo((ClientSessionsCreateRequest) other); @@ -69,15 +88,22 @@ public Map getAdditionalProperties() { private boolean equalTo(ClientSessionsCreateRequest other) { return userIdentifierKey.equals(other.userIdentifierKey) && connectWebviewIds.equals(other.connectWebviewIds) - && connectedAccountIds.equals(other.connectedAccountIds); + && connectedAccountIds.equals(other.connectedAccountIds) + && userIdentityIds.equals(other.userIdentityIds) + && expiresAt.equals(other.expiresAt); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.userIdentifierKey, this.connectWebviewIds, this.connectedAccountIds); + return Objects.hash( + this.userIdentifierKey, + this.connectWebviewIds, + this.connectedAccountIds, + this.userIdentityIds, + this.expiresAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,6 +120,10 @@ public static final class Builder { private Optional> connectedAccountIds = Optional.empty(); + private Optional> userIdentityIds = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -103,6 +133,8 @@ public Builder from(ClientSessionsCreateRequest other) { userIdentifierKey(other.getUserIdentifierKey()); connectWebviewIds(other.getConnectWebviewIds()); connectedAccountIds(other.getConnectedAccountIds()); + userIdentityIds(other.getUserIdentityIds()); + expiresAt(other.getExpiresAt()); return this; } @@ -139,9 +171,36 @@ public Builder connectedAccountIds(List connectedAccountIds) { return this; } + @JsonSetter(value = "user_identity_ids", nulls = Nulls.SKIP) + public Builder userIdentityIds(Optional> userIdentityIds) { + this.userIdentityIds = userIdentityIds; + return this; + } + + public Builder userIdentityIds(List userIdentityIds) { + this.userIdentityIds = Optional.of(userIdentityIds); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.of(expiresAt); + return this; + } + public ClientSessionsCreateRequest build() { return new ClientSessionsCreateRequest( - userIdentifierKey, connectWebviewIds, connectedAccountIds, additionalProperties); + userIdentifierKey, + connectWebviewIds, + connectedAccountIds, + userIdentityIds, + expiresAt, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsDeleteRequest.java b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsDeleteRequest.java index 63d51d0..1f57e1b 100644 --- a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsDeleteRequest.java @@ -32,7 +32,7 @@ public String getClientSessionId() { return clientSessionId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsDeleteRequest && equalTo((ClientSessionsDeleteRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(ClientSessionsDeleteRequest other) { return clientSessionId.equals(other.clientSessionId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientSessionId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements ClientSessionIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClientSessionsDeleteRequest other) { clientSessionId(other.getClientSessionId()); return this; } - @Override + @java.lang.Override @JsonSetter("client_session_id") public _FinalStage clientSessionId(String clientSessionId) { this.clientSessionId = clientSessionId; return this; } - @Override + @java.lang.Override public ClientSessionsDeleteRequest build() { return new ClientSessionsDeleteRequest(clientSessionId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetOrCreateRequest.java b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetOrCreateRequest.java new file mode 100644 index 0000000..9371ea0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetOrCreateRequest.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.clientsessions.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ClientSessionsGetOrCreateRequest.Builder.class) +public final class ClientSessionsGetOrCreateRequest { + private final Optional userIdentifierKey; + + private final Optional> connectWebviewIds; + + private final Optional> connectedAccountIds; + + private final Optional> userIdentityIds; + + private final Optional expiresAt; + + private final Map additionalProperties; + + private ClientSessionsGetOrCreateRequest( + Optional userIdentifierKey, + Optional> connectWebviewIds, + Optional> connectedAccountIds, + Optional> userIdentityIds, + Optional expiresAt, + Map additionalProperties) { + this.userIdentifierKey = userIdentifierKey; + this.connectWebviewIds = connectWebviewIds; + this.connectedAccountIds = connectedAccountIds; + this.userIdentityIds = userIdentityIds; + this.expiresAt = expiresAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @JsonProperty("connect_webview_ids") + public Optional> getConnectWebviewIds() { + return connectWebviewIds; + } + + @JsonProperty("connected_account_ids") + public Optional> getConnectedAccountIds() { + return connectedAccountIds; + } + + @JsonProperty("user_identity_ids") + public Optional> getUserIdentityIds() { + return userIdentityIds; + } + + @JsonProperty("expires_at") + public Optional getExpiresAt() { + return expiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSessionsGetOrCreateRequest && equalTo((ClientSessionsGetOrCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSessionsGetOrCreateRequest other) { + return userIdentifierKey.equals(other.userIdentifierKey) + && connectWebviewIds.equals(other.connectWebviewIds) + && connectedAccountIds.equals(other.connectedAccountIds) + && userIdentityIds.equals(other.userIdentityIds) + && expiresAt.equals(other.expiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userIdentifierKey, + this.connectWebviewIds, + this.connectedAccountIds, + this.userIdentityIds, + this.expiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userIdentifierKey = Optional.empty(); + + private Optional> connectWebviewIds = Optional.empty(); + + private Optional> connectedAccountIds = Optional.empty(); + + private Optional> userIdentityIds = Optional.empty(); + + private Optional expiresAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientSessionsGetOrCreateRequest other) { + userIdentifierKey(other.getUserIdentifierKey()); + connectWebviewIds(other.getConnectWebviewIds()); + connectedAccountIds(other.getConnectedAccountIds()); + userIdentityIds(other.getUserIdentityIds()); + expiresAt(other.getExpiresAt()); + return this; + } + + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public Builder userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + public Builder userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @JsonSetter(value = "connect_webview_ids", nulls = Nulls.SKIP) + public Builder connectWebviewIds(Optional> connectWebviewIds) { + this.connectWebviewIds = connectWebviewIds; + return this; + } + + public Builder connectWebviewIds(List connectWebviewIds) { + this.connectWebviewIds = Optional.of(connectWebviewIds); + return this; + } + + @JsonSetter(value = "connected_account_ids", nulls = Nulls.SKIP) + public Builder connectedAccountIds(Optional> connectedAccountIds) { + this.connectedAccountIds = connectedAccountIds; + return this; + } + + public Builder connectedAccountIds(List connectedAccountIds) { + this.connectedAccountIds = Optional.of(connectedAccountIds); + return this; + } + + @JsonSetter(value = "user_identity_ids", nulls = Nulls.SKIP) + public Builder userIdentityIds(Optional> userIdentityIds) { + this.userIdentityIds = userIdentityIds; + return this; + } + + public Builder userIdentityIds(List userIdentityIds) { + this.userIdentityIds = Optional.of(userIdentityIds); + return this; + } + + @JsonSetter(value = "expires_at", nulls = Nulls.SKIP) + public Builder expiresAt(Optional expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + public Builder expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = Optional.of(expiresAt); + return this; + } + + public ClientSessionsGetOrCreateRequest build() { + return new ClientSessionsGetOrCreateRequest( + userIdentifierKey, + connectWebviewIds, + connectedAccountIds, + userIdentityIds, + expiresAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetRequest.java b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetRequest.java index 228377d..bfcbf56 100644 --- a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetRequest.java +++ b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGetRequest.java @@ -45,7 +45,7 @@ public Optional getUserIdentifierKey() { return userIdentifierKey; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsGetRequest && equalTo((ClientSessionsGetRequest) other); @@ -60,12 +60,12 @@ private boolean equalTo(ClientSessionsGetRequest other) { return clientSessionId.equals(other.clientSessionId) && userIdentifierKey.equals(other.userIdentifierKey); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientSessionId, this.userIdentifierKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGrantAccessRequest.java b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGrantAccessRequest.java new file mode 100644 index 0000000..eac8ffd --- /dev/null +++ b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsGrantAccessRequest.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.clientsessions.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ClientSessionsGrantAccessRequest.Builder.class) +public final class ClientSessionsGrantAccessRequest { + private final Optional clientSessionId; + + private final Optional userIdentifierKey; + + private final Optional> connectedAccountIds; + + private final Optional> connectWebviewIds; + + private final Optional> userIdentityIds; + + private final Map additionalProperties; + + private ClientSessionsGrantAccessRequest( + Optional clientSessionId, + Optional userIdentifierKey, + Optional> connectedAccountIds, + Optional> connectWebviewIds, + Optional> userIdentityIds, + Map additionalProperties) { + this.clientSessionId = clientSessionId; + this.userIdentifierKey = userIdentifierKey; + this.connectedAccountIds = connectedAccountIds; + this.connectWebviewIds = connectWebviewIds; + this.userIdentityIds = userIdentityIds; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_session_id") + public Optional getClientSessionId() { + return clientSessionId; + } + + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @JsonProperty("connected_account_ids") + public Optional> getConnectedAccountIds() { + return connectedAccountIds; + } + + @JsonProperty("connect_webview_ids") + public Optional> getConnectWebviewIds() { + return connectWebviewIds; + } + + @JsonProperty("user_identity_ids") + public Optional> getUserIdentityIds() { + return userIdentityIds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSessionsGrantAccessRequest && equalTo((ClientSessionsGrantAccessRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSessionsGrantAccessRequest other) { + return clientSessionId.equals(other.clientSessionId) + && userIdentifierKey.equals(other.userIdentifierKey) + && connectedAccountIds.equals(other.connectedAccountIds) + && connectWebviewIds.equals(other.connectWebviewIds) + && userIdentityIds.equals(other.userIdentityIds); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientSessionId, + this.userIdentifierKey, + this.connectedAccountIds, + this.connectWebviewIds, + this.userIdentityIds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientSessionId = Optional.empty(); + + private Optional userIdentifierKey = Optional.empty(); + + private Optional> connectedAccountIds = Optional.empty(); + + private Optional> connectWebviewIds = Optional.empty(); + + private Optional> userIdentityIds = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ClientSessionsGrantAccessRequest other) { + clientSessionId(other.getClientSessionId()); + userIdentifierKey(other.getUserIdentifierKey()); + connectedAccountIds(other.getConnectedAccountIds()); + connectWebviewIds(other.getConnectWebviewIds()); + userIdentityIds(other.getUserIdentityIds()); + return this; + } + + @JsonSetter(value = "client_session_id", nulls = Nulls.SKIP) + public Builder clientSessionId(Optional clientSessionId) { + this.clientSessionId = clientSessionId; + return this; + } + + public Builder clientSessionId(String clientSessionId) { + this.clientSessionId = Optional.of(clientSessionId); + return this; + } + + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public Builder userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + public Builder userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @JsonSetter(value = "connected_account_ids", nulls = Nulls.SKIP) + public Builder connectedAccountIds(Optional> connectedAccountIds) { + this.connectedAccountIds = connectedAccountIds; + return this; + } + + public Builder connectedAccountIds(List connectedAccountIds) { + this.connectedAccountIds = Optional.of(connectedAccountIds); + return this; + } + + @JsonSetter(value = "connect_webview_ids", nulls = Nulls.SKIP) + public Builder connectWebviewIds(Optional> connectWebviewIds) { + this.connectWebviewIds = connectWebviewIds; + return this; + } + + public Builder connectWebviewIds(List connectWebviewIds) { + this.connectWebviewIds = Optional.of(connectWebviewIds); + return this; + } + + @JsonSetter(value = "user_identity_ids", nulls = Nulls.SKIP) + public Builder userIdentityIds(Optional> userIdentityIds) { + this.userIdentityIds = userIdentityIds; + return this; + } + + public Builder userIdentityIds(List userIdentityIds) { + this.userIdentityIds = Optional.of(userIdentityIds); + return this; + } + + public ClientSessionsGrantAccessRequest build() { + return new ClientSessionsGrantAccessRequest( + clientSessionId, + userIdentifierKey, + connectedAccountIds, + connectWebviewIds, + userIdentityIds, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsListRequest.java b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsListRequest.java index aba3c0e..4b0fb9b 100644 --- a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsListRequest.java +++ b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsListRequest.java @@ -24,18 +24,26 @@ public final class ClientSessionsListRequest { private final Optional userIdentifierKey; + private final Optional connectWebviewId; + private final Optional withoutUserIdentifierKey; + private final Optional userIdentityId; + private final Map additionalProperties; private ClientSessionsListRequest( Optional clientSessionId, Optional userIdentifierKey, + Optional connectWebviewId, Optional withoutUserIdentifierKey, + Optional userIdentityId, Map additionalProperties) { this.clientSessionId = clientSessionId; this.userIdentifierKey = userIdentifierKey; + this.connectWebviewId = connectWebviewId; this.withoutUserIdentifierKey = withoutUserIdentifierKey; + this.userIdentityId = userIdentityId; this.additionalProperties = additionalProperties; } @@ -49,12 +57,22 @@ public Optional getUserIdentifierKey() { return userIdentifierKey; } + @JsonProperty("connect_webview_id") + public Optional getConnectWebviewId() { + return connectWebviewId; + } + @JsonProperty("without_user_identifier_key") public Optional getWithoutUserIdentifierKey() { return withoutUserIdentifierKey; } - @Override + @JsonProperty("user_identity_id") + public Optional getUserIdentityId() { + return userIdentityId; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsListRequest && equalTo((ClientSessionsListRequest) other); @@ -68,15 +86,22 @@ public Map getAdditionalProperties() { private boolean equalTo(ClientSessionsListRequest other) { return clientSessionId.equals(other.clientSessionId) && userIdentifierKey.equals(other.userIdentifierKey) - && withoutUserIdentifierKey.equals(other.withoutUserIdentifierKey); + && connectWebviewId.equals(other.connectWebviewId) + && withoutUserIdentifierKey.equals(other.withoutUserIdentifierKey) + && userIdentityId.equals(other.userIdentityId); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.clientSessionId, this.userIdentifierKey, this.withoutUserIdentifierKey); + return Objects.hash( + this.clientSessionId, + this.userIdentifierKey, + this.connectWebviewId, + this.withoutUserIdentifierKey, + this.userIdentityId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -91,8 +116,12 @@ public static final class Builder { private Optional userIdentifierKey = Optional.empty(); + private Optional connectWebviewId = Optional.empty(); + private Optional withoutUserIdentifierKey = Optional.empty(); + private Optional userIdentityId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -101,7 +130,9 @@ private Builder() {} public Builder from(ClientSessionsListRequest other) { clientSessionId(other.getClientSessionId()); userIdentifierKey(other.getUserIdentifierKey()); + connectWebviewId(other.getConnectWebviewId()); withoutUserIdentifierKey(other.getWithoutUserIdentifierKey()); + userIdentityId(other.getUserIdentityId()); return this; } @@ -127,6 +158,17 @@ public Builder userIdentifierKey(String userIdentifierKey) { return this; } + @JsonSetter(value = "connect_webview_id", nulls = Nulls.SKIP) + public Builder connectWebviewId(Optional connectWebviewId) { + this.connectWebviewId = connectWebviewId; + return this; + } + + public Builder connectWebviewId(String connectWebviewId) { + this.connectWebviewId = Optional.of(connectWebviewId); + return this; + } + @JsonSetter(value = "without_user_identifier_key", nulls = Nulls.SKIP) public Builder withoutUserIdentifierKey(Optional withoutUserIdentifierKey) { this.withoutUserIdentifierKey = withoutUserIdentifierKey; @@ -138,9 +180,25 @@ public Builder withoutUserIdentifierKey(Boolean withoutUserIdentifierKey) { return this; } + @JsonSetter(value = "user_identity_id", nulls = Nulls.SKIP) + public Builder userIdentityId(Optional userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + public Builder userIdentityId(String userIdentityId) { + this.userIdentityId = Optional.of(userIdentityId); + return this; + } + public ClientSessionsListRequest build() { return new ClientSessionsListRequest( - clientSessionId, userIdentifierKey, withoutUserIdentifierKey, additionalProperties); + clientSessionId, + userIdentifierKey, + connectWebviewId, + withoutUserIdentifierKey, + userIdentityId, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsRevokeRequest.java b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsRevokeRequest.java new file mode 100644 index 0000000..59cb8ad --- /dev/null +++ b/src/main/java/com/seam/api/resources/clientsessions/requests/ClientSessionsRevokeRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.clientsessions.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ClientSessionsRevokeRequest.Builder.class) +public final class ClientSessionsRevokeRequest { + private final String clientSessionId; + + private final Map additionalProperties; + + private ClientSessionsRevokeRequest(String clientSessionId, Map additionalProperties) { + this.clientSessionId = clientSessionId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_session_id") + public String getClientSessionId() { + return clientSessionId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSessionsRevokeRequest && equalTo((ClientSessionsRevokeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSessionsRevokeRequest other) { + return clientSessionId.equals(other.clientSessionId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientSessionId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientSessionIdStage builder() { + return new Builder(); + } + + public interface ClientSessionIdStage { + _FinalStage clientSessionId(String clientSessionId); + + Builder from(ClientSessionsRevokeRequest other); + } + + public interface _FinalStage { + ClientSessionsRevokeRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientSessionIdStage, _FinalStage { + private String clientSessionId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientSessionsRevokeRequest other) { + clientSessionId(other.getClientSessionId()); + return this; + } + + @java.lang.Override + @JsonSetter("client_session_id") + public _FinalStage clientSessionId(String clientSessionId) { + this.clientSessionId = clientSessionId; + return this; + } + + @java.lang.Override + public ClientSessionsRevokeRequest build() { + return new ClientSessionsRevokeRequest(clientSessionId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ClientSessionsCreateResponse.java b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsCreateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClientSessionsCreateResponse.java rename to src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsCreateResponse.java index 42c5e34..2a2422c 100644 --- a/src/main/java/com/seam/api/types/ClientSessionsCreateResponse.java +++ b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsCreateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.clientsessions.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClientSession; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsCreateResponse && equalTo((ClientSessionsCreateResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(ClientSessionsCreateResponse other) { return clientSession.equals(other.clientSession) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientSession, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ClientSessionStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(ClientSessionsCreateResponse other) { clientSession(other.getClientSession()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("client_session") public OkStage clientSession(ClientSession clientSession) { this.clientSession = clientSession; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ClientSessionsCreateResponse build() { return new ClientSessionsCreateResponse(clientSession, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ClientSessionsDeleteResponse.java b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClientSessionsDeleteResponse.java rename to src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsDeleteResponse.java index c6ee7b1..4399a35 100644 --- a/src/main/java/com/seam/api/types/ClientSessionsDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.clientsessions.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsDeleteResponse && equalTo((ClientSessionsDeleteResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(ClientSessionsDeleteResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClientSessionsDeleteResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ClientSessionsDeleteResponse build() { return new ClientSessionsDeleteResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGetOrCreateResponse.java b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGetOrCreateResponse.java new file mode 100644 index 0000000..a6ed967 --- /dev/null +++ b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGetOrCreateResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.clientsessions.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClientSession; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ClientSessionsGetOrCreateResponse.Builder.class) +public final class ClientSessionsGetOrCreateResponse { + private final ClientSession clientSession; + + private final boolean ok; + + private final Map additionalProperties; + + private ClientSessionsGetOrCreateResponse( + ClientSession clientSession, boolean ok, Map additionalProperties) { + this.clientSession = clientSession; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_session") + public ClientSession getClientSession() { + return clientSession; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSessionsGetOrCreateResponse && equalTo((ClientSessionsGetOrCreateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSessionsGetOrCreateResponse other) { + return clientSession.equals(other.clientSession) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientSession, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientSessionStage builder() { + return new Builder(); + } + + public interface ClientSessionStage { + OkStage clientSession(ClientSession clientSession); + + Builder from(ClientSessionsGetOrCreateResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + ClientSessionsGetOrCreateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientSessionStage, OkStage, _FinalStage { + private ClientSession clientSession; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientSessionsGetOrCreateResponse other) { + clientSession(other.getClientSession()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("client_session") + public OkStage clientSession(ClientSession clientSession) { + this.clientSession = clientSession; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ClientSessionsGetOrCreateResponse build() { + return new ClientSessionsGetOrCreateResponse(clientSession, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ClientSessionsGetResponse.java b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClientSessionsGetResponse.java rename to src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGetResponse.java index 9e9ca5c..5a3a609 100644 --- a/src/main/java/com/seam/api/types/ClientSessionsGetResponse.java +++ b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.clientsessions.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClientSession; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsGetResponse && equalTo((ClientSessionsGetResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(ClientSessionsGetResponse other) { return clientSession.equals(other.clientSession) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientSession, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ClientSessionStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(ClientSessionsGetResponse other) { clientSession(other.getClientSession()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("client_session") public OkStage clientSession(ClientSession clientSession) { this.clientSession = clientSession; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ClientSessionsGetResponse build() { return new ClientSessionsGetResponse(clientSession, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGrantAccessResponse.java b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGrantAccessResponse.java new file mode 100644 index 0000000..5a20f5e --- /dev/null +++ b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsGrantAccessResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.clientsessions.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClientSession; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ClientSessionsGrantAccessResponse.Builder.class) +public final class ClientSessionsGrantAccessResponse { + private final ClientSession clientSession; + + private final boolean ok; + + private final Map additionalProperties; + + private ClientSessionsGrantAccessResponse( + ClientSession clientSession, boolean ok, Map additionalProperties) { + this.clientSession = clientSession; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("client_session") + public ClientSession getClientSession() { + return clientSession; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSessionsGrantAccessResponse && equalTo((ClientSessionsGrantAccessResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSessionsGrantAccessResponse other) { + return clientSession.equals(other.clientSession) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.clientSession, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientSessionStage builder() { + return new Builder(); + } + + public interface ClientSessionStage { + OkStage clientSession(ClientSession clientSession); + + Builder from(ClientSessionsGrantAccessResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + ClientSessionsGrantAccessResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientSessionStage, OkStage, _FinalStage { + private ClientSession clientSession; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientSessionsGrantAccessResponse other) { + clientSession(other.getClientSession()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("client_session") + public OkStage clientSession(ClientSession clientSession) { + this.clientSession = clientSession; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ClientSessionsGrantAccessResponse build() { + return new ClientSessionsGrantAccessResponse(clientSession, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ClientSessionsListResponse.java b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClientSessionsListResponse.java rename to src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsListResponse.java index d7375e8..005fb54 100644 --- a/src/main/java/com/seam/api/types/ClientSessionsListResponse.java +++ b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.clientsessions.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClientSession; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSessionsListResponse && equalTo((ClientSessionsListResponse) other); @@ -59,12 +60,12 @@ private boolean equalTo(ClientSessionsListResponse other) { return clientSessions.equals(other.clientSessions) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.clientSessions, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,33 +101,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClientSessionsListResponse other) { clientSessions(other.getClientSessions()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllClientSessions(List clientSessions) { this.clientSessions.addAll(clientSessions); return this; } - @Override + @java.lang.Override public _FinalStage addClientSessions(ClientSession clientSessions) { this.clientSessions.add(clientSessions); return this; } - @Override + @java.lang.Override @JsonSetter(value = "client_sessions", nulls = Nulls.SKIP) public _FinalStage clientSessions(List clientSessions) { this.clientSessions.clear(); @@ -134,7 +135,7 @@ public _FinalStage clientSessions(List clientSessions) { return this; } - @Override + @java.lang.Override public ClientSessionsListResponse build() { return new ClientSessionsListResponse(clientSessions, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsRevokeResponse.java b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsRevokeResponse.java new file mode 100644 index 0000000..f7e604b --- /dev/null +++ b/src/main/java/com/seam/api/resources/clientsessions/types/ClientSessionsRevokeResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.clientsessions.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ClientSessionsRevokeResponse.Builder.class) +public final class ClientSessionsRevokeResponse { + private final boolean ok; + + private final Map additionalProperties; + + private ClientSessionsRevokeResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientSessionsRevokeResponse && equalTo((ClientSessionsRevokeResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientSessionsRevokeResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(ClientSessionsRevokeResponse other); + } + + public interface _FinalStage { + ClientSessionsRevokeResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientSessionsRevokeResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ClientSessionsRevokeResponse build() { + return new ClientSessionsRevokeResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/connectedaccounts/ConnectedAccountsClient.java b/src/main/java/com/seam/api/resources/connectedaccounts/ConnectedAccountsClient.java index eca7925..11606a6 100644 --- a/src/main/java/com/seam/api/resources/connectedaccounts/ConnectedAccountsClient.java +++ b/src/main/java/com/seam/api/resources/connectedaccounts/ConnectedAccountsClient.java @@ -3,24 +3,33 @@ */ package com.seam.api.resources.connectedaccounts; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.connectedaccounts.requests.ConnectedAccountsDeleteRequest; +import com.seam.api.resources.connectedaccounts.requests.ConnectedAccountsListRequest; +import com.seam.api.resources.connectedaccounts.requests.ConnectedAccountsUpdateRequest; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsDeleteResponse; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsGetRequest; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsGetResponse; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsListResponse; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsUpdateResponse; import com.seam.api.types.ConnectedAccount; -import com.seam.api.types.ConnectedAccountsDeleteResponse; -import com.seam.api.types.ConnectedAccountsGetRequest; -import com.seam.api.types.ConnectedAccountsGetResponse; -import com.seam.api.types.ConnectedAccountsListResponse; import java.io.IOException; import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class ConnectedAccountsClient { protected final ClientOptions clientOptions; @@ -29,11 +38,12 @@ public ConnectedAccountsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public void delete(ConnectedAccountsDeleteRequest request) { - delete(request, null); + public ConnectedAccountsDeleteResponse delete(ConnectedAccountsDeleteRequest request) { + return delete(request, null); } - public void delete(ConnectedAccountsDeleteRequest request, RequestOptions requestOptions) { + public ConnectedAccountsDeleteResponse delete( + ConnectedAccountsDeleteRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("connected_accounts/delete") @@ -41,9 +51,9 @@ public void delete(ConnectedAccountsDeleteRequest request, RequestOptions reques RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -51,18 +61,35 @@ public void delete(ConnectedAccountsDeleteRequest request, RequestOptions reques .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ConnectedAccountsDeleteResponse.class); - return; + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ConnectedAccountsDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -78,9 +105,9 @@ public ConnectedAccount get(ConnectedAccountsGetRequest request, RequestOptions RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -88,50 +115,150 @@ public ConnectedAccount get(ConnectedAccountsGetRequest request, RequestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ConnectedAccountsGetResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ConnectedAccountsGetResponse.class); + ConnectedAccountsGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConnectedAccountsGetResponse.class); return parsedResponse.getConnectedAccount(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } public List list() { - return list(null); + return list(ConnectedAccountsListRequest.builder().build()); } - public List list(RequestOptions requestOptions) { + public List list(ConnectedAccountsListRequest request) { + return list(request, null); + } + + public List list(ConnectedAccountsListRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("connected_accounts/list") .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("POST", RequestBody.create("", null)) + .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ConnectedAccountsListResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ConnectedAccountsListResponse.class); + ConnectedAccountsListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConnectedAccountsListResponse.class); return parsedResponse.getConnectedAccounts(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public ConnectedAccount update(ConnectedAccountsUpdateRequest request) { + return update(request, null); + } + + public ConnectedAccount update(ConnectedAccountsUpdateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("connected_accounts/update") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + ConnectedAccountsUpdateResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ConnectedAccountsUpdateResponse.class); + return parsedResponse.getConnectedAccount(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsDeleteRequest.java b/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsDeleteRequest.java index ca78aec..5f9bcb0 100644 --- a/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsDeleteRequest.java @@ -9,21 +9,27 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = ConnectedAccountsDeleteRequest.Builder.class) public final class ConnectedAccountsDeleteRequest { private final String connectedAccountId; + private final Optional sync; + private final Map additionalProperties; - private ConnectedAccountsDeleteRequest(String connectedAccountId, Map additionalProperties) { + private ConnectedAccountsDeleteRequest( + String connectedAccountId, Optional sync, Map additionalProperties) { this.connectedAccountId = connectedAccountId; + this.sync = sync; this.additionalProperties = additionalProperties; } @@ -32,7 +38,12 @@ public String getConnectedAccountId() { return connectedAccountId; } - @Override + @JsonProperty("sync") + public Optional getSync() { + return sync; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccountsDeleteRequest && equalTo((ConnectedAccountsDeleteRequest) other); @@ -44,15 +55,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(ConnectedAccountsDeleteRequest other) { - return connectedAccountId.equals(other.connectedAccountId); + return connectedAccountId.equals(other.connectedAccountId) && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.connectedAccountId); + return Objects.hash(this.connectedAccountId, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -69,33 +80,53 @@ public interface ConnectedAccountIdStage { public interface _FinalStage { ConnectedAccountsDeleteRequest build(); + + _FinalStage sync(Optional sync); + + _FinalStage sync(Boolean sync); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ConnectedAccountIdStage, _FinalStage { private String connectedAccountId; + private Optional sync = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectedAccountsDeleteRequest other) { connectedAccountId(other.getConnectedAccountId()); + sync(other.getSync()); return this; } - @Override + @java.lang.Override @JsonSetter("connected_account_id") public _FinalStage connectedAccountId(String connectedAccountId) { this.connectedAccountId = connectedAccountId; return this; } - @Override + @java.lang.Override + public _FinalStage sync(Boolean sync) { + this.sync = Optional.of(sync); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sync", nulls = Nulls.SKIP) + public _FinalStage sync(Optional sync) { + this.sync = sync; + return this; + } + + @java.lang.Override public ConnectedAccountsDeleteRequest build() { - return new ConnectedAccountsDeleteRequest(connectedAccountId, additionalProperties); + return new ConnectedAccountsDeleteRequest(connectedAccountId, sync, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsListRequest.java b/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsListRequest.java new file mode 100644 index 0000000..f017578 --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsListRequest.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectedaccounts.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsListRequestCustomMetadataHasValue; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ConnectedAccountsListRequest.Builder.class) +public final class ConnectedAccountsListRequest { + private final Optional> customMetadataHas; + + private final Map additionalProperties; + + private ConnectedAccountsListRequest( + Optional> customMetadataHas, + Map additionalProperties) { + this.customMetadataHas = customMetadataHas; + this.additionalProperties = additionalProperties; + } + + /** + * @return

devices where the account's custom_metadata contains all of the provided key/value pairs.

+ */ + @JsonProperty("custom_metadata_has") + public Optional> getCustomMetadataHas() { + return customMetadataHas; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectedAccountsListRequest && equalTo((ConnectedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectedAccountsListRequest other) { + return customMetadataHas.equals(other.customMetadataHas); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.customMetadataHas); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> customMetadataHas = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectedAccountsListRequest other) { + customMetadataHas(other.getCustomMetadataHas()); + return this; + } + + @JsonSetter(value = "custom_metadata_has", nulls = Nulls.SKIP) + public Builder customMetadataHas( + Optional> customMetadataHas) { + this.customMetadataHas = customMetadataHas; + return this; + } + + public Builder customMetadataHas( + Map customMetadataHas) { + this.customMetadataHas = Optional.of(customMetadataHas); + return this; + } + + public ConnectedAccountsListRequest build() { + return new ConnectedAccountsListRequest(customMetadataHas, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsUpdateRequest.java b/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsUpdateRequest.java new file mode 100644 index 0000000..124c9ae --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectedaccounts/requests/ConnectedAccountsUpdateRequest.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectedaccounts.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsUpdateRequestCustomMetadataValue; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ConnectedAccountsUpdateRequest.Builder.class) +public final class ConnectedAccountsUpdateRequest { + private final String connectedAccountId; + + private final Optional automaticallyManageNewDevices; + + private final Optional>> customMetadata; + + private final Map additionalProperties; + + private ConnectedAccountsUpdateRequest( + String connectedAccountId, + Optional automaticallyManageNewDevices, + Optional>> customMetadata, + Map additionalProperties) { + this.connectedAccountId = connectedAccountId; + this.automaticallyManageNewDevices = automaticallyManageNewDevices; + this.customMetadata = customMetadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connected_account_id") + public String getConnectedAccountId() { + return connectedAccountId; + } + + @JsonProperty("automatically_manage_new_devices") + public Optional getAutomaticallyManageNewDevices() { + return automaticallyManageNewDevices; + } + + @JsonProperty("custom_metadata") + public Optional>> getCustomMetadata() { + return customMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectedAccountsUpdateRequest && equalTo((ConnectedAccountsUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectedAccountsUpdateRequest other) { + return connectedAccountId.equals(other.connectedAccountId) + && automaticallyManageNewDevices.equals(other.automaticallyManageNewDevices) + && customMetadata.equals(other.customMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectedAccountId, this.automaticallyManageNewDevices, this.customMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectedAccountIdStage builder() { + return new Builder(); + } + + public interface ConnectedAccountIdStage { + _FinalStage connectedAccountId(String connectedAccountId); + + Builder from(ConnectedAccountsUpdateRequest other); + } + + public interface _FinalStage { + ConnectedAccountsUpdateRequest build(); + + _FinalStage automaticallyManageNewDevices(Optional automaticallyManageNewDevices); + + _FinalStage automaticallyManageNewDevices(Boolean automaticallyManageNewDevices); + + _FinalStage customMetadata( + Optional>> customMetadata); + + _FinalStage customMetadata( + Map> customMetadata); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectedAccountIdStage, _FinalStage { + private String connectedAccountId; + + private Optional>> customMetadata = + Optional.empty(); + + private Optional automaticallyManageNewDevices = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectedAccountsUpdateRequest other) { + connectedAccountId(other.getConnectedAccountId()); + automaticallyManageNewDevices(other.getAutomaticallyManageNewDevices()); + customMetadata(other.getCustomMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("connected_account_id") + public _FinalStage connectedAccountId(String connectedAccountId) { + this.connectedAccountId = connectedAccountId; + return this; + } + + @java.lang.Override + public _FinalStage customMetadata( + Map> customMetadata) { + this.customMetadata = Optional.of(customMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) + public _FinalStage customMetadata( + Optional>> customMetadata) { + this.customMetadata = customMetadata; + return this; + } + + @java.lang.Override + public _FinalStage automaticallyManageNewDevices(Boolean automaticallyManageNewDevices) { + this.automaticallyManageNewDevices = Optional.of(automaticallyManageNewDevices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "automatically_manage_new_devices", nulls = Nulls.SKIP) + public _FinalStage automaticallyManageNewDevices(Optional automaticallyManageNewDevices) { + this.automaticallyManageNewDevices = automaticallyManageNewDevices; + return this; + } + + @java.lang.Override + public ConnectedAccountsUpdateRequest build() { + return new ConnectedAccountsUpdateRequest( + connectedAccountId, automaticallyManageNewDevices, customMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ConnectedAccountsDeleteResponse.java b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ConnectedAccountsDeleteResponse.java rename to src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsDeleteResponse.java index 688e1eb..0bcd11b 100644 --- a/src/main/java/com/seam/api/types/ConnectedAccountsDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.connectedaccounts.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccountsDeleteResponse && equalTo((ConnectedAccountsDeleteResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(ConnectedAccountsDeleteResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectedAccountsDeleteResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ConnectedAccountsDeleteResponse build() { return new ConnectedAccountsDeleteResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ConnectedAccountsGetRequest.java b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsGetRequest.java similarity index 72% rename from src/main/java/com/seam/api/types/ConnectedAccountsGetRequest.java rename to src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsGetRequest.java index 7b0fe45..e80780d 100644 --- a/src/main/java/com/seam/api/types/ConnectedAccountsGetRequest.java +++ b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsGetRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.connectedaccounts.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -38,7 +38,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccountsGetRequest && equalTo((ConnectedAccountsGetRequest) other); @@ -48,27 +48,22 @@ private boolean equalTo(ConnectedAccountsGetRequest other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } - public static ConnectedAccountsGetRequest id(String id) { - return new ConnectedAccountsGetRequest( - ConnectedAccountsGetRequestConnectedAccountId.builder() - .connectedAccountId(id) - .build(), - 0); + public static ConnectedAccountsGetRequest of(ConnectedAccountsGetRequestConnectedAccountId value) { + return new ConnectedAccountsGetRequest(value, 0); } - public static ConnectedAccountsGetRequest email(String email) { - return new ConnectedAccountsGetRequest( - ConnectedAccountsGetRequestEmail.builder().email(email).build(), 1); + public static ConnectedAccountsGetRequest of(ConnectedAccountsGetRequestEmail value) { + return new ConnectedAccountsGetRequest(value, 1); } public interface Visitor { @@ -82,19 +77,16 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectedAccountsListRequestCustomMetadataHasValue + && equalTo((ConnectedAccountsListRequestCustomMetadataHasValue) other); + } + + private boolean equalTo(ConnectedAccountsListRequestCustomMetadataHasValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ConnectedAccountsListRequestCustomMetadataHasValue of(String value) { + return new ConnectedAccountsListRequestCustomMetadataHasValue(value, 0); + } + + public static ConnectedAccountsListRequestCustomMetadataHasValue of(boolean value) { + return new ConnectedAccountsListRequestCustomMetadataHasValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConnectedAccountsListRequestCustomMetadataHasValue.class); + } + + @java.lang.Override + public ConnectedAccountsListRequestCustomMetadataHasValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/types/ConnectedAccountsListResponse.java b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ConnectedAccountsListResponse.java rename to src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsListResponse.java index 600d93e..5e20127 100644 --- a/src/main/java/com/seam/api/types/ConnectedAccountsListResponse.java +++ b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.connectedaccounts.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ConnectedAccount; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccountsListResponse && equalTo((ConnectedAccountsListResponse) other); @@ -59,12 +60,12 @@ private boolean equalTo(ConnectedAccountsListResponse other) { return connectedAccounts.equals(other.connectedAccounts) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectedAccounts, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,33 +101,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectedAccountsListResponse other) { connectedAccounts(other.getConnectedAccounts()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllConnectedAccounts(List connectedAccounts) { this.connectedAccounts.addAll(connectedAccounts); return this; } - @Override + @java.lang.Override public _FinalStage addConnectedAccounts(ConnectedAccount connectedAccounts) { this.connectedAccounts.add(connectedAccounts); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connected_accounts", nulls = Nulls.SKIP) public _FinalStage connectedAccounts(List connectedAccounts) { this.connectedAccounts.clear(); @@ -134,7 +135,7 @@ public _FinalStage connectedAccounts(List connectedAccounts) { return this; } - @Override + @java.lang.Override public ConnectedAccountsListResponse build() { return new ConnectedAccountsListResponse(connectedAccounts, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateRequestCustomMetadataValue.java b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateRequestCustomMetadataValue.java new file mode 100644 index 0000000..95d62db --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateRequestCustomMetadataValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectedaccounts.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ConnectedAccountsUpdateRequestCustomMetadataValue.Deserializer.class) +public final class ConnectedAccountsUpdateRequestCustomMetadataValue { + private final Object value; + + private final int type; + + private ConnectedAccountsUpdateRequestCustomMetadataValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectedAccountsUpdateRequestCustomMetadataValue + && equalTo((ConnectedAccountsUpdateRequestCustomMetadataValue) other); + } + + private boolean equalTo(ConnectedAccountsUpdateRequestCustomMetadataValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ConnectedAccountsUpdateRequestCustomMetadataValue of(String value) { + return new ConnectedAccountsUpdateRequestCustomMetadataValue(value, 0); + } + + public static ConnectedAccountsUpdateRequestCustomMetadataValue of(boolean value) { + return new ConnectedAccountsUpdateRequestCustomMetadataValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConnectedAccountsUpdateRequestCustomMetadataValue.class); + } + + @java.lang.Override + public ConnectedAccountsUpdateRequestCustomMetadataValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateResponse.java b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateResponse.java new file mode 100644 index 0000000..383780d --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsUpdateResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectedaccounts.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ConnectedAccount; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ConnectedAccountsUpdateResponse.Builder.class) +public final class ConnectedAccountsUpdateResponse { + private final ConnectedAccount connectedAccount; + + private final boolean ok; + + private final Map additionalProperties; + + private ConnectedAccountsUpdateResponse( + ConnectedAccount connectedAccount, boolean ok, Map additionalProperties) { + this.connectedAccount = connectedAccount; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("connected_account") + public ConnectedAccount getConnectedAccount() { + return connectedAccount; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectedAccountsUpdateResponse && equalTo((ConnectedAccountsUpdateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectedAccountsUpdateResponse other) { + return connectedAccount.equals(other.connectedAccount) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.connectedAccount, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConnectedAccountStage builder() { + return new Builder(); + } + + public interface ConnectedAccountStage { + OkStage connectedAccount(ConnectedAccount connectedAccount); + + Builder from(ConnectedAccountsUpdateResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + ConnectedAccountsUpdateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConnectedAccountStage, OkStage, _FinalStage { + private ConnectedAccount connectedAccount; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConnectedAccountsUpdateResponse other) { + connectedAccount(other.getConnectedAccount()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("connected_account") + public OkStage connectedAccount(ConnectedAccount connectedAccount) { + this.connectedAccount = connectedAccount; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ConnectedAccountsUpdateResponse build() { + return new ConnectedAccountsUpdateResponse(connectedAccount, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java b/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java index 185acb6..df2b87f 100644 --- a/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java @@ -3,27 +3,33 @@ */ package com.seam.api.resources.connectwebviews; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.connectwebviews.requests.ConnectWebviewsCreateRequest; import com.seam.api.resources.connectwebviews.requests.ConnectWebviewsDeleteRequest; import com.seam.api.resources.connectwebviews.requests.ConnectWebviewsGetRequest; -import com.seam.api.resources.connectwebviews.requests.ConnectWebviewsViewRequest; +import com.seam.api.resources.connectwebviews.requests.ConnectWebviewsListRequest; +import com.seam.api.resources.connectwebviews.types.ConnectWebviewsCreateResponse; +import com.seam.api.resources.connectwebviews.types.ConnectWebviewsDeleteResponse; +import com.seam.api.resources.connectwebviews.types.ConnectWebviewsGetResponse; +import com.seam.api.resources.connectwebviews.types.ConnectWebviewsListResponse; import com.seam.api.types.ConnectWebview; -import com.seam.api.types.ConnectWebviewsCreateResponse; -import com.seam.api.types.ConnectWebviewsDeleteResponse; -import com.seam.api.types.ConnectWebviewsGetResponse; -import com.seam.api.types.ConnectWebviewsListResponse; import java.io.IOException; import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class ConnectWebviewsClient { protected final ClientOptions clientOptions; @@ -32,6 +38,10 @@ public ConnectWebviewsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + public ConnectWebview create() { + return create(ConnectWebviewsCreateRequest.builder().build()); + } + public ConnectWebview create(ConnectWebviewsCreateRequest request) { return create(request, null); } @@ -44,9 +54,9 @@ public ConnectWebview create(ConnectWebviewsCreateRequest request, RequestOption RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -54,31 +64,44 @@ public ConnectWebview create(ConnectWebviewsCreateRequest request, RequestOption .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ConnectWebviewsCreateResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ConnectWebviewsCreateResponse.class); + ConnectWebviewsCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConnectWebviewsCreateResponse.class); return parsedResponse.getConnectWebview(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ConnectWebview create() { - return create(ConnectWebviewsCreateRequest.builder().build()); + public ConnectWebviewsDeleteResponse delete(ConnectWebviewsDeleteRequest request) { + return delete(request, null); } - public void delete(ConnectWebviewsDeleteRequest request) { - delete(request, null); - } - - public void delete(ConnectWebviewsDeleteRequest request, RequestOptions requestOptions) { + public ConnectWebviewsDeleteResponse delete(ConnectWebviewsDeleteRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("connect_webviews/delete") @@ -86,9 +109,9 @@ public void delete(ConnectWebviewsDeleteRequest request, RequestOptions requestO RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -96,27 +119,37 @@ public void delete(ConnectWebviewsDeleteRequest request, RequestOptions requestO .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ConnectWebviewsDeleteResponse.class); - return; + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConnectWebviewsDeleteResponse.class); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ConnectWebview getById(String connectWebviewId) { - return get(ConnectWebviewsGetRequest.builder() - .connectWebviewId(connectWebviewId) - .build()); - } - public ConnectWebview get(ConnectWebviewsGetRequest request) { return get(request, null); } @@ -129,9 +162,9 @@ public ConnectWebview get(ConnectWebviewsGetRequest request, RequestOptions requ RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -139,79 +172,95 @@ public ConnectWebview get(ConnectWebviewsGetRequest request, RequestOptions requ .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { ConnectWebviewsGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ConnectWebviewsGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConnectWebviewsGetResponse.class); return parsedResponse.getConnectWebview(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } public List list() { - return list(null); + return list(ConnectWebviewsListRequest.builder().build()); } - public List list(RequestOptions requestOptions) { + public List list(ConnectWebviewsListRequest request) { + return list(request, null); + } + + public List list(ConnectWebviewsListRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("connect_webviews/list") .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("POST", RequestBody.create("", null)) + .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ConnectWebviewsListResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ConnectWebviewsListResponse.class); + ConnectWebviewsListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConnectWebviewsListResponse.class); return parsedResponse.getConnectWebviews(); } - throw new ApiError( - response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public void view(ConnectWebviewsViewRequest request) { - view(request, null); - } - - public void view(ConnectWebviewsViewRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("connect_webviews/view"); - httpUrl.addQueryParameter("connect_webview_id", request.getConnectWebviewId()); - httpUrl.addQueryParameter("auth_token", request.getAuthToken()); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))); - Request okhttpRequest = _requestBuilder.build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); - if (response.isSuccessful()) { - return; + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsCreateRequest.java b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsCreateRequest.java index 31b55f1..db14b12 100644 --- a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsCreateRequest.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsCreateRequest.java @@ -12,8 +12,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.AcceptedProvider; -import com.seam.api.types.CustomMetadataValue; +import com.seam.api.resources.connectwebviews.types.AcceptedProvider; +import com.seam.api.resources.connectwebviews.types.ConnectWebviewsCreateRequestCustomMetadataValue; import com.seam.api.types.ProviderCategory; import com.seam.api.types.SelectionMode; import java.util.HashMap; @@ -35,7 +35,7 @@ public final class ConnectWebviewsCreateRequest { private final Optional providerCategory; - private final Optional> customMetadata; + private final Optional>> customMetadata; private final Optional automaticallyManageNewDevices; @@ -49,7 +49,7 @@ private ConnectWebviewsCreateRequest( Optional customRedirectFailureUrl, Optional> acceptedProviders, Optional providerCategory, - Optional> customMetadata, + Optional>> customMetadata, Optional automaticallyManageNewDevices, Optional waitForDeviceCreation, Map additionalProperties) { @@ -90,7 +90,7 @@ public Optional getProviderCategory() { } @JsonProperty("custom_metadata") - public Optional> getCustomMetadata() { + public Optional>> getCustomMetadata() { return customMetadata; } @@ -104,7 +104,7 @@ public Optional getWaitForDeviceCreation() { return waitForDeviceCreation; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebviewsCreateRequest && equalTo((ConnectWebviewsCreateRequest) other); @@ -126,7 +126,7 @@ private boolean equalTo(ConnectWebviewsCreateRequest other) { && waitForDeviceCreation.equals(other.waitForDeviceCreation); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.deviceSelectionMode, @@ -139,7 +139,7 @@ public int hashCode() { this.waitForDeviceCreation); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -160,7 +160,8 @@ public static final class Builder { private Optional providerCategory = Optional.empty(); - private Optional> customMetadata = Optional.empty(); + private Optional>> customMetadata = + Optional.empty(); private Optional automaticallyManageNewDevices = Optional.empty(); @@ -239,12 +240,14 @@ public Builder providerCategory(ProviderCategory providerCategory) { } @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) - public Builder customMetadata(Optional> customMetadata) { + public Builder customMetadata( + Optional>> customMetadata) { this.customMetadata = customMetadata; return this; } - public Builder customMetadata(Map customMetadata) { + public Builder customMetadata( + Map> customMetadata) { this.customMetadata = Optional.of(customMetadata); return this; } diff --git a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsDeleteRequest.java b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsDeleteRequest.java index d6785a0..3732e84 100644 --- a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsDeleteRequest.java @@ -32,7 +32,7 @@ public String getConnectWebviewId() { return connectWebviewId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebviewsDeleteRequest && equalTo((ConnectWebviewsDeleteRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(ConnectWebviewsDeleteRequest other) { return connectWebviewId.equals(other.connectWebviewId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectWebviewId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements ConnectWebviewIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectWebviewsDeleteRequest other) { connectWebviewId(other.getConnectWebviewId()); return this; } - @Override + @java.lang.Override @JsonSetter("connect_webview_id") public _FinalStage connectWebviewId(String connectWebviewId) { this.connectWebviewId = connectWebviewId; return this; } - @Override + @java.lang.Override public ConnectWebviewsDeleteRequest build() { return new ConnectWebviewsDeleteRequest(connectWebviewId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsGetRequest.java b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsGetRequest.java index f2e571b..58ffbc1 100644 --- a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsGetRequest.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsGetRequest.java @@ -32,7 +32,7 @@ public String getConnectWebviewId() { return connectWebviewId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebviewsGetRequest && equalTo((ConnectWebviewsGetRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(ConnectWebviewsGetRequest other) { return connectWebviewId.equals(other.connectWebviewId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectWebviewId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements ConnectWebviewIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectWebviewsGetRequest other) { connectWebviewId(other.getConnectWebviewId()); return this; } - @Override + @java.lang.Override @JsonSetter("connect_webview_id") public _FinalStage connectWebviewId(String connectWebviewId) { this.connectWebviewId = connectWebviewId; return this; } - @Override + @java.lang.Override public ConnectWebviewsGetRequest build() { return new ConnectWebviewsGetRequest(connectWebviewId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsListRequest.java b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsListRequest.java new file mode 100644 index 0000000..f65dcf0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsListRequest.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectwebviews.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.connectwebviews.types.ConnectWebviewsListRequestCustomMetadataHasValue; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ConnectWebviewsListRequest.Builder.class) +public final class ConnectWebviewsListRequest { + private final Optional userIdentifierKey; + + private final Optional> customMetadataHas; + + private final Optional limit; + + private final Map additionalProperties; + + private ConnectWebviewsListRequest( + Optional userIdentifierKey, + Optional> customMetadataHas, + Optional limit, + Map additionalProperties) { + this.userIdentifierKey = userIdentifierKey; + this.customMetadataHas = customMetadataHas; + this.limit = limit; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + /** + * @return

devices where the webview's custom_metadata contains all of the provided key/value pairs.

+ */ + @JsonProperty("custom_metadata_has") + public Optional> getCustomMetadataHas() { + return customMetadataHas; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectWebviewsListRequest && equalTo((ConnectWebviewsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConnectWebviewsListRequest other) { + return userIdentifierKey.equals(other.userIdentifierKey) + && customMetadataHas.equals(other.customMetadataHas) + && limit.equals(other.limit); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentifierKey, this.customMetadataHas, this.limit); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userIdentifierKey = Optional.empty(); + + private Optional> customMetadataHas = + Optional.empty(); + + private Optional limit = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConnectWebviewsListRequest other) { + userIdentifierKey(other.getUserIdentifierKey()); + customMetadataHas(other.getCustomMetadataHas()); + limit(other.getLimit()); + return this; + } + + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public Builder userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + public Builder userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @JsonSetter(value = "custom_metadata_has", nulls = Nulls.SKIP) + public Builder customMetadataHas( + Optional> customMetadataHas) { + this.customMetadataHas = customMetadataHas; + return this; + } + + public Builder customMetadataHas( + Map customMetadataHas) { + this.customMetadataHas = Optional.of(customMetadataHas); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.of(limit); + return this; + } + + public ConnectWebviewsListRequest build() { + return new ConnectWebviewsListRequest(userIdentifierKey, customMetadataHas, limit, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsViewRequest.java b/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsViewRequest.java deleted file mode 100644 index 7b2f153..0000000 --- a/src/main/java/com/seam/api/resources/connectwebviews/requests/ConnectWebviewsViewRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.resources.connectwebviews.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ConnectWebviewsViewRequest.Builder.class) -public final class ConnectWebviewsViewRequest { - private final String connectWebviewId; - - private final String authToken; - - private final Map additionalProperties; - - private ConnectWebviewsViewRequest( - String connectWebviewId, String authToken, Map additionalProperties) { - this.connectWebviewId = connectWebviewId; - this.authToken = authToken; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("connect_webview_id") - public String getConnectWebviewId() { - return connectWebviewId; - } - - @JsonProperty("auth_token") - public String getAuthToken() { - return authToken; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConnectWebviewsViewRequest && equalTo((ConnectWebviewsViewRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConnectWebviewsViewRequest other) { - return connectWebviewId.equals(other.connectWebviewId) && authToken.equals(other.authToken); - } - - @Override - public int hashCode() { - return Objects.hash(this.connectWebviewId, this.authToken); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ConnectWebviewIdStage builder() { - return new Builder(); - } - - public interface ConnectWebviewIdStage { - AuthTokenStage connectWebviewId(String connectWebviewId); - - Builder from(ConnectWebviewsViewRequest other); - } - - public interface AuthTokenStage { - _FinalStage authToken(String authToken); - } - - public interface _FinalStage { - ConnectWebviewsViewRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ConnectWebviewIdStage, AuthTokenStage, _FinalStage { - private String connectWebviewId; - - private String authToken; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(ConnectWebviewsViewRequest other) { - connectWebviewId(other.getConnectWebviewId()); - authToken(other.getAuthToken()); - return this; - } - - @Override - @JsonSetter("connect_webview_id") - public AuthTokenStage connectWebviewId(String connectWebviewId) { - this.connectWebviewId = connectWebviewId; - return this; - } - - @Override - @JsonSetter("auth_token") - public _FinalStage authToken(String authToken) { - this.authToken = authToken; - return this; - } - - @Override - public ConnectWebviewsViewRequest build() { - return new ConnectWebviewsViewRequest(connectWebviewId, authToken, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/resources/connectwebviews/types/AcceptedProvider.java b/src/main/java/com/seam/api/resources/connectwebviews/types/AcceptedProvider.java new file mode 100644 index 0000000..29721e9 --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectwebviews/types/AcceptedProvider.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectwebviews.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcceptedProvider { + AKUVOX("akuvox"), + + AUGUST("august"), + + AVIGILON_ALTA("avigilon_alta"), + + BRIVO("brivo"), + + BUTTERFLYMX("butterflymx"), + + SCHLAGE("schlage"), + + SMARTTHINGS("smartthings"), + + YALE("yale"), + + GENIE("genie"), + + DOORKING("doorking"), + + SALTO("salto"), + + LOCKLY("lockly"), + + TTLOCK("ttlock"), + + LINEAR("linear"), + + NOISEAWARE("noiseaware"), + + NUKI("nuki"), + + SEAM_RELAY_ADMIN("seam_relay_admin"), + + IGLOO("igloo"), + + KWIKSET("kwikset"), + + MINUT("minut"), + + MY_2_N("my_2n"), + + CONTROLBYWEB("controlbyweb"), + + NEST("nest"), + + IGLOOHOME("igloohome"), + + ECOBEE("ecobee"), + + HUBITAT("hubitat"), + + FOUR_SUITES("four_suites"), + + DORMAKABA_ORACODE("dormakaba_oracode"), + + PTI("pti"), + + WYZE("wyze"), + + SEAM_PASSPORT("seam_passport"), + + VISIONLINE("visionline"), + + ASSA_ABLOY_CREDENTIAL_SERVICE("assa_abloy_credential_service"), + + SEAM_BRIDGE("seam_bridge"), + + TEDEE("tedee"), + + HONEYWELL_RESIDEO("honeywell_resideo"), + + LATCH("latch"), + + YALE_ACCESS("yale_access"), + + HID_CM("hid_cm"), + + GOOGLE_NEST("google_nest"); + + private final String value; + + AcceptedProvider(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsCreateRequestCustomMetadataValue.java b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsCreateRequestCustomMetadataValue.java new file mode 100644 index 0000000..995fd89 --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsCreateRequestCustomMetadataValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectwebviews.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ConnectWebviewsCreateRequestCustomMetadataValue.Deserializer.class) +public final class ConnectWebviewsCreateRequestCustomMetadataValue { + private final Object value; + + private final int type; + + private ConnectWebviewsCreateRequestCustomMetadataValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectWebviewsCreateRequestCustomMetadataValue + && equalTo((ConnectWebviewsCreateRequestCustomMetadataValue) other); + } + + private boolean equalTo(ConnectWebviewsCreateRequestCustomMetadataValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ConnectWebviewsCreateRequestCustomMetadataValue of(String value) { + return new ConnectWebviewsCreateRequestCustomMetadataValue(value, 0); + } + + public static ConnectWebviewsCreateRequestCustomMetadataValue of(boolean value) { + return new ConnectWebviewsCreateRequestCustomMetadataValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConnectWebviewsCreateRequestCustomMetadataValue.class); + } + + @java.lang.Override + public ConnectWebviewsCreateRequestCustomMetadataValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/types/ConnectWebviewsCreateResponse.java b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsCreateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ConnectWebviewsCreateResponse.java rename to src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsCreateResponse.java index 466eca1..791e0ec 100644 --- a/src/main/java/com/seam/api/types/ConnectWebviewsCreateResponse.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsCreateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.connectwebviews.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ConnectWebview; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebviewsCreateResponse && equalTo((ConnectWebviewsCreateResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(ConnectWebviewsCreateResponse other) { return connectWebview.equals(other.connectWebview) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectWebview, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ConnectWebviewStage, OkStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectWebviewsCreateResponse other) { connectWebview(other.getConnectWebview()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("connect_webview") public OkStage connectWebview(ConnectWebview connectWebview) { this.connectWebview = connectWebview; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ConnectWebviewsCreateResponse build() { return new ConnectWebviewsCreateResponse(connectWebview, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ConnectWebviewsDeleteResponse.java b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ConnectWebviewsDeleteResponse.java rename to src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsDeleteResponse.java index b78e5ee..8d8ad3a 100644 --- a/src/main/java/com/seam/api/types/ConnectWebviewsDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.connectwebviews.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebviewsDeleteResponse && equalTo((ConnectWebviewsDeleteResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(ConnectWebviewsDeleteResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectWebviewsDeleteResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ConnectWebviewsDeleteResponse build() { return new ConnectWebviewsDeleteResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ConnectWebviewsGetResponse.java b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ConnectWebviewsGetResponse.java rename to src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsGetResponse.java index 704c4e6..905467f 100644 --- a/src/main/java/com/seam/api/types/ConnectWebviewsGetResponse.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.connectwebviews.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ConnectWebview; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebviewsGetResponse && equalTo((ConnectWebviewsGetResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(ConnectWebviewsGetResponse other) { return connectWebview.equals(other.connectWebview) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectWebview, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ConnectWebviewStage, OkStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectWebviewsGetResponse other) { connectWebview(other.getConnectWebview()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("connect_webview") public OkStage connectWebview(ConnectWebview connectWebview) { this.connectWebview = connectWebview; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ConnectWebviewsGetResponse build() { return new ConnectWebviewsGetResponse(connectWebview, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsListRequestCustomMetadataHasValue.java b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsListRequestCustomMetadataHasValue.java new file mode 100644 index 0000000..12adb21 --- /dev/null +++ b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsListRequestCustomMetadataHasValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.connectwebviews.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ConnectWebviewsListRequestCustomMetadataHasValue.Deserializer.class) +public final class ConnectWebviewsListRequestCustomMetadataHasValue { + private final Object value; + + private final int type; + + private ConnectWebviewsListRequestCustomMetadataHasValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConnectWebviewsListRequestCustomMetadataHasValue + && equalTo((ConnectWebviewsListRequestCustomMetadataHasValue) other); + } + + private boolean equalTo(ConnectWebviewsListRequestCustomMetadataHasValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ConnectWebviewsListRequestCustomMetadataHasValue of(String value) { + return new ConnectWebviewsListRequestCustomMetadataHasValue(value, 0); + } + + public static ConnectWebviewsListRequestCustomMetadataHasValue of(boolean value) { + return new ConnectWebviewsListRequestCustomMetadataHasValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConnectWebviewsListRequestCustomMetadataHasValue.class); + } + + @java.lang.Override + public ConnectWebviewsListRequestCustomMetadataHasValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/types/ConnectWebviewsListResponse.java b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ConnectWebviewsListResponse.java rename to src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsListResponse.java index 9da6dce..a6848c0 100644 --- a/src/main/java/com/seam/api/types/ConnectWebviewsListResponse.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/types/ConnectWebviewsListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.connectwebviews.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ConnectWebview; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebviewsListResponse && equalTo((ConnectWebviewsListResponse) other); @@ -59,12 +60,12 @@ private boolean equalTo(ConnectWebviewsListResponse other) { return connectWebviews.equals(other.connectWebviews) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.connectWebviews, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,33 +101,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectWebviewsListResponse other) { connectWebviews(other.getConnectWebviews()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllConnectWebviews(List connectWebviews) { this.connectWebviews.addAll(connectWebviews); return this; } - @Override + @java.lang.Override public _FinalStage addConnectWebviews(ConnectWebview connectWebviews) { this.connectWebviews.add(connectWebviews); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connect_webviews", nulls = Nulls.SKIP) public _FinalStage connectWebviews(List connectWebviews) { this.connectWebviews.clear(); @@ -134,7 +135,7 @@ public _FinalStage connectWebviews(List connectWebviews) { return this; } - @Override + @java.lang.Override public ConnectWebviewsListResponse build() { return new ConnectWebviewsListResponse(connectWebviews, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/devices/DevicesClient.java b/src/main/java/com/seam/api/resources/devices/DevicesClient.java index 87fba4b..a846bb3 100644 --- a/src/main/java/com/seam/api/resources/devices/DevicesClient.java +++ b/src/main/java/com/seam/api/resources/devices/DevicesClient.java @@ -3,49 +3,59 @@ */ package com.seam.api.resources.devices; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; import com.seam.api.core.Suppliers; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.devices.requests.DevicesDeleteRequest; import com.seam.api.resources.devices.requests.DevicesGetRequest; import com.seam.api.resources.devices.requests.DevicesListDeviceProvidersRequest; import com.seam.api.resources.devices.requests.DevicesListRequest; import com.seam.api.resources.devices.requests.DevicesUpdateRequest; +import com.seam.api.resources.devices.simulate.SimulateClient; +import com.seam.api.resources.devices.types.DevicesDeleteResponse; +import com.seam.api.resources.devices.types.DevicesGetResponse; +import com.seam.api.resources.devices.types.DevicesListDeviceProvidersResponse; +import com.seam.api.resources.devices.types.DevicesListResponse; +import com.seam.api.resources.devices.types.DevicesUpdateResponse; import com.seam.api.resources.devices.unmanaged.UnmanagedClient; import com.seam.api.types.Device; -import com.seam.api.types.DeviceListProvider; -import com.seam.api.types.DevicesDeleteResponse; -import com.seam.api.types.DevicesGetResponse; -import com.seam.api.types.DevicesListDeviceProvidersResponse; -import com.seam.api.types.DevicesListResponse; -import com.seam.api.types.DevicesUpdateResponse; +import com.seam.api.types.DeviceProvider; import java.io.IOException; import java.util.List; import java.util.function.Supplier; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class DevicesClient { protected final ClientOptions clientOptions; + protected final Supplier simulateClient; + protected final Supplier unmanagedClient; public DevicesClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; + this.simulateClient = Suppliers.memoize(() -> new SimulateClient(clientOptions)); this.unmanagedClient = Suppliers.memoize(() -> new UnmanagedClient(clientOptions)); } - public void delete(DevicesDeleteRequest request) { - delete(request, null); + public DevicesDeleteResponse delete(DevicesDeleteRequest request) { + return delete(request, null); } - public void delete(DevicesDeleteRequest request, RequestOptions requestOptions) { + public DevicesDeleteResponse delete(DevicesDeleteRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("devices/delete") @@ -53,9 +63,9 @@ public void delete(DevicesDeleteRequest request, RequestOptions requestOptions) RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -63,21 +73,41 @@ public void delete(DevicesDeleteRequest request, RequestOptions requestOptions) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), DevicesDeleteResponse.class); - return; + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DevicesDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } + public Device get() { + return get(DevicesGetRequest.builder().build()); + } + public Device get(DevicesGetRequest request) { return get(request, null); } @@ -90,9 +120,9 @@ public Device get(DevicesGetRequest request, RequestOptions requestOptions) { RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -100,24 +130,41 @@ public Device get(DevicesGetRequest request, RequestOptions requestOptions) { .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { DevicesGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), DevicesGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DevicesGetResponse.class); return parsedResponse.getDevice(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public Device get() { - return get(DevicesGetRequest.builder().build()); + public List list() { + return list(DevicesListRequest.builder().build()); } public List list(DevicesListRequest request) { @@ -132,9 +179,9 @@ public List list(DevicesListRequest request, RequestOptions requestOptio RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -142,31 +189,48 @@ public List list(DevicesListRequest request, RequestOptions requestOptio .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { DevicesListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), DevicesListResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DevicesListResponse.class); return parsedResponse.getDevices(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public List list() { - return list(DevicesListRequest.builder().build()); + public List listDeviceProviders() { + return listDeviceProviders(DevicesListDeviceProvidersRequest.builder().build()); } - public List listDeviceProviders(DevicesListDeviceProvidersRequest request) { + public List listDeviceProviders(DevicesListDeviceProvidersRequest request) { return listDeviceProviders(request, null); } - public List listDeviceProviders( + public List listDeviceProviders( DevicesListDeviceProvidersRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -175,9 +239,9 @@ public List listDeviceProviders( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -185,31 +249,44 @@ public List listDeviceProviders( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { DevicesListDeviceProvidersResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), DevicesListDeviceProvidersResponse.class); + responseBody.string(), DevicesListDeviceProvidersResponse.class); return parsedResponse.getDeviceProviders(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public List listDeviceProviders() { - return listDeviceProviders(DevicesListDeviceProvidersRequest.builder().build()); - } - - public void update(DevicesUpdateRequest request) { - update(request, null); + public DevicesUpdateResponse update(DevicesUpdateRequest request) { + return update(request, null); } - public void update(DevicesUpdateRequest request, RequestOptions requestOptions) { + public DevicesUpdateResponse update(DevicesUpdateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("devices/update") @@ -217,9 +294,9 @@ public void update(DevicesUpdateRequest request, RequestOptions requestOptions) RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -227,21 +304,41 @@ public void update(DevicesUpdateRequest request, RequestOptions requestOptions) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), DevicesUpdateResponse.class); - return; + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DevicesUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } + public SimulateClient simulate() { + return this.simulateClient.get(); + } + public UnmanagedClient unmanaged() { return this.unmanagedClient.get(); } diff --git a/src/main/java/com/seam/api/resources/devices/requests/DevicesDeleteRequest.java b/src/main/java/com/seam/api/resources/devices/requests/DevicesDeleteRequest.java index 52a02ce..bd58a40 100644 --- a/src/main/java/com/seam/api/resources/devices/requests/DevicesDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/devices/requests/DevicesDeleteRequest.java @@ -32,7 +32,7 @@ public String getDeviceId() { return deviceId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesDeleteRequest && equalTo((DevicesDeleteRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(DevicesDeleteRequest other) { return deviceId.equals(other.deviceId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DevicesDeleteRequest other) { deviceId(other.getDeviceId()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public DevicesDeleteRequest build() { return new DevicesDeleteRequest(deviceId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/devices/requests/DevicesGetRequest.java b/src/main/java/com/seam/api/resources/devices/requests/DevicesGetRequest.java index 01c41a7..0d3838e 100644 --- a/src/main/java/com/seam/api/resources/devices/requests/DevicesGetRequest.java +++ b/src/main/java/com/seam/api/resources/devices/requests/DevicesGetRequest.java @@ -43,7 +43,7 @@ public Optional getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesGetRequest && equalTo((DevicesGetRequest) other); @@ -58,12 +58,12 @@ private boolean equalTo(DevicesGetRequest other) { return deviceId.equals(other.deviceId) && name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/resources/devices/requests/DevicesListDeviceProvidersRequest.java b/src/main/java/com/seam/api/resources/devices/requests/DevicesListDeviceProvidersRequest.java index 7be6402..1c1b0e2 100644 --- a/src/main/java/com/seam/api/resources/devices/requests/DevicesListDeviceProvidersRequest.java +++ b/src/main/java/com/seam/api/resources/devices/requests/DevicesListDeviceProvidersRequest.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.DevicesListDeviceProvidersRequestProviderCategory; +import com.seam.api.types.ProviderCategory; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -21,23 +21,22 @@ @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = DevicesListDeviceProvidersRequest.Builder.class) public final class DevicesListDeviceProvidersRequest { - private final Optional providerCategory; + private final Optional providerCategory; private final Map additionalProperties; private DevicesListDeviceProvidersRequest( - Optional providerCategory, - Map additionalProperties) { + Optional providerCategory, Map additionalProperties) { this.providerCategory = providerCategory; this.additionalProperties = additionalProperties; } @JsonProperty("provider_category") - public Optional getProviderCategory() { + public Optional getProviderCategory() { return providerCategory; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesListDeviceProvidersRequest && equalTo((DevicesListDeviceProvidersRequest) other); @@ -52,12 +51,12 @@ private boolean equalTo(DevicesListDeviceProvidersRequest other) { return providerCategory.equals(other.providerCategory); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.providerCategory); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -68,7 +67,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional providerCategory = Optional.empty(); + private Optional providerCategory = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -81,12 +80,12 @@ public Builder from(DevicesListDeviceProvidersRequest other) { } @JsonSetter(value = "provider_category", nulls = Nulls.SKIP) - public Builder providerCategory(Optional providerCategory) { + public Builder providerCategory(Optional providerCategory) { this.providerCategory = providerCategory; return this; } - public Builder providerCategory(DevicesListDeviceProvidersRequestProviderCategory providerCategory) { + public Builder providerCategory(ProviderCategory providerCategory) { this.providerCategory = Optional.of(providerCategory); return this; } diff --git a/src/main/java/com/seam/api/resources/devices/requests/DevicesListRequest.java b/src/main/java/com/seam/api/resources/devices/requests/DevicesListRequest.java index 70ac2b4..19b5535 100644 --- a/src/main/java/com/seam/api/resources/devices/requests/DevicesListRequest.java +++ b/src/main/java/com/seam/api/resources/devices/requests/DevicesListRequest.java @@ -12,6 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.devices.types.DevicesListRequestCustomMetadataHasValue; +import com.seam.api.resources.devices.types.DevicesListRequestExcludeIfItem; +import com.seam.api.resources.devices.types.DevicesListRequestIncludeIfItem; import com.seam.api.types.DeviceType; import com.seam.api.types.Manufacturer; import java.time.OffsetDateTime; @@ -42,6 +45,14 @@ public final class DevicesListRequest { private final Optional createdBefore; + private final Optional userIdentifierKey; + + private final Optional> customMetadataHas; + + private final Optional> includeIf; + + private final Optional> excludeIf; + private final Map additionalProperties; private DevicesListRequest( @@ -54,6 +65,10 @@ private DevicesListRequest( Optional> deviceIds, Optional limit, Optional createdBefore, + Optional userIdentifierKey, + Optional> customMetadataHas, + Optional> includeIf, + Optional> excludeIf, Map additionalProperties) { this.connectedAccountId = connectedAccountId; this.connectedAccountIds = connectedAccountIds; @@ -64,9 +79,16 @@ private DevicesListRequest( this.deviceIds = deviceIds; this.limit = limit; this.createdBefore = createdBefore; + this.userIdentifierKey = userIdentifierKey; + this.customMetadataHas = customMetadataHas; + this.includeIf = includeIf; + this.excludeIf = excludeIf; this.additionalProperties = additionalProperties; } + /** + * @return List all devices owned by this connected account + */ @JsonProperty("connected_account_id") public Optional getConnectedAccountId() { return connectedAccountId; @@ -112,7 +134,27 @@ public Optional getCreatedBefore() { return createdBefore; } - @Override + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @JsonProperty("custom_metadata_has") + public Optional> getCustomMetadataHas() { + return customMetadataHas; + } + + @JsonProperty("include_if") + public Optional> getIncludeIf() { + return includeIf; + } + + @JsonProperty("exclude_if") + public Optional> getExcludeIf() { + return excludeIf; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesListRequest && equalTo((DevicesListRequest) other); @@ -132,10 +174,14 @@ private boolean equalTo(DevicesListRequest other) { && manufacturer.equals(other.manufacturer) && deviceIds.equals(other.deviceIds) && limit.equals(other.limit) - && createdBefore.equals(other.createdBefore); + && createdBefore.equals(other.createdBefore) + && userIdentifierKey.equals(other.userIdentifierKey) + && customMetadataHas.equals(other.customMetadataHas) + && includeIf.equals(other.includeIf) + && excludeIf.equals(other.excludeIf); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectedAccountId, @@ -146,10 +192,14 @@ public int hashCode() { this.manufacturer, this.deviceIds, this.limit, - this.createdBefore); + this.createdBefore, + this.userIdentifierKey, + this.customMetadataHas, + this.includeIf, + this.excludeIf); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -178,6 +228,14 @@ public static final class Builder { private Optional createdBefore = Optional.empty(); + private Optional userIdentifierKey = Optional.empty(); + + private Optional> customMetadataHas = Optional.empty(); + + private Optional> includeIf = Optional.empty(); + + private Optional> excludeIf = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -193,6 +251,10 @@ public Builder from(DevicesListRequest other) { deviceIds(other.getDeviceIds()); limit(other.getLimit()); createdBefore(other.getCreatedBefore()); + userIdentifierKey(other.getUserIdentifierKey()); + customMetadataHas(other.getCustomMetadataHas()); + includeIf(other.getIncludeIf()); + excludeIf(other.getExcludeIf()); return this; } @@ -295,6 +357,51 @@ public Builder createdBefore(OffsetDateTime createdBefore) { return this; } + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public Builder userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + public Builder userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @JsonSetter(value = "custom_metadata_has", nulls = Nulls.SKIP) + public Builder customMetadataHas( + Optional> customMetadataHas) { + this.customMetadataHas = customMetadataHas; + return this; + } + + public Builder customMetadataHas(Map customMetadataHas) { + this.customMetadataHas = Optional.of(customMetadataHas); + return this; + } + + @JsonSetter(value = "include_if", nulls = Nulls.SKIP) + public Builder includeIf(Optional> includeIf) { + this.includeIf = includeIf; + return this; + } + + public Builder includeIf(List includeIf) { + this.includeIf = Optional.of(includeIf); + return this; + } + + @JsonSetter(value = "exclude_if", nulls = Nulls.SKIP) + public Builder excludeIf(Optional> excludeIf) { + this.excludeIf = excludeIf; + return this; + } + + public Builder excludeIf(List excludeIf) { + this.excludeIf = Optional.of(excludeIf); + return this; + } + public DevicesListRequest build() { return new DevicesListRequest( connectedAccountId, @@ -306,6 +413,10 @@ public DevicesListRequest build() { deviceIds, limit, createdBefore, + userIdentifierKey, + customMetadataHas, + includeIf, + excludeIf, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/devices/requests/DevicesUpdateRequest.java b/src/main/java/com/seam/api/resources/devices/requests/DevicesUpdateRequest.java index a224875..53480a8 100644 --- a/src/main/java/com/seam/api/resources/devices/requests/DevicesUpdateRequest.java +++ b/src/main/java/com/seam/api/resources/devices/requests/DevicesUpdateRequest.java @@ -12,8 +12,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.DevicesUpdateRequestLocation; -import com.seam.api.types.DevicesUpdateRequestProperties; +import com.seam.api.resources.devices.types.DevicesUpdateRequestCustomMetadataValue; +import com.seam.api.resources.devices.types.DevicesUpdateRequestProperties; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -28,24 +28,24 @@ public final class DevicesUpdateRequest { private final Optional name; - private final Optional location; - private final Optional isManaged; + private final Optional>> customMetadata; + private final Map additionalProperties; private DevicesUpdateRequest( String deviceId, Optional properties, Optional name, - Optional location, Optional isManaged, + Optional>> customMetadata, Map additionalProperties) { this.deviceId = deviceId; this.properties = properties; this.name = name; - this.location = location; this.isManaged = isManaged; + this.customMetadata = customMetadata; this.additionalProperties = additionalProperties; } @@ -64,17 +64,17 @@ public Optional getName() { return name; } - @JsonProperty("location") - public Optional getLocation() { - return location; - } - @JsonProperty("is_managed") public Optional getIsManaged() { return isManaged; } - @Override + @JsonProperty("custom_metadata") + public Optional>> getCustomMetadata() { + return customMetadata; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesUpdateRequest && equalTo((DevicesUpdateRequest) other); @@ -89,16 +89,16 @@ private boolean equalTo(DevicesUpdateRequest other) { return deviceId.equals(other.deviceId) && properties.equals(other.properties) && name.equals(other.name) - && location.equals(other.location) - && isManaged.equals(other.isManaged); + && isManaged.equals(other.isManaged) + && customMetadata.equals(other.customMetadata); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.deviceId, this.properties, this.name, this.location, this.isManaged); + return Objects.hash(this.deviceId, this.properties, this.name, this.isManaged, this.customMetadata); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -124,22 +124,24 @@ public interface _FinalStage { _FinalStage name(String name); - _FinalStage location(Optional location); - - _FinalStage location(DevicesUpdateRequestLocation location); - _FinalStage isManaged(Optional isManaged); _FinalStage isManaged(Boolean isManaged); + + _FinalStage customMetadata( + Optional>> customMetadata); + + _FinalStage customMetadata(Map> customMetadata); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceIdStage, _FinalStage { private String deviceId; - private Optional isManaged = Optional.empty(); + private Optional>> customMetadata = + Optional.empty(); - private Optional location = Optional.empty(); + private Optional isManaged = Optional.empty(); private Optional name = Optional.empty(); @@ -150,78 +152,81 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DevicesUpdateRequest other) { deviceId(other.getDeviceId()); properties(other.getProperties()); name(other.getName()); - location(other.getLocation()); isManaged(other.getIsManaged()); + customMetadata(other.getCustomMetadata()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override - public _FinalStage isManaged(Boolean isManaged) { - this.isManaged = Optional.of(isManaged); + @java.lang.Override + public _FinalStage customMetadata( + Map> customMetadata) { + this.customMetadata = Optional.of(customMetadata); return this; } - @Override - @JsonSetter(value = "is_managed", nulls = Nulls.SKIP) - public _FinalStage isManaged(Optional isManaged) { - this.isManaged = isManaged; + @java.lang.Override + @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) + public _FinalStage customMetadata( + Optional>> customMetadata) { + this.customMetadata = customMetadata; return this; } - @Override - public _FinalStage location(DevicesUpdateRequestLocation location) { - this.location = Optional.of(location); + @java.lang.Override + public _FinalStage isManaged(Boolean isManaged) { + this.isManaged = Optional.of(isManaged); return this; } - @Override - @JsonSetter(value = "location", nulls = Nulls.SKIP) - public _FinalStage location(Optional location) { - this.location = location; + @java.lang.Override + @JsonSetter(value = "is_managed", nulls = Nulls.SKIP) + public _FinalStage isManaged(Optional isManaged) { + this.isManaged = isManaged; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage properties(DevicesUpdateRequestProperties properties) { this.properties = Optional.of(properties); return this; } - @Override + @java.lang.Override @JsonSetter(value = "properties", nulls = Nulls.SKIP) public _FinalStage properties(Optional properties) { this.properties = properties; return this; } - @Override + @java.lang.Override public DevicesUpdateRequest build() { - return new DevicesUpdateRequest(deviceId, properties, name, location, isManaged, additionalProperties); + return new DevicesUpdateRequest( + deviceId, properties, name, isManaged, customMetadata, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/devices/simulate/SimulateClient.java b/src/main/java/com/seam/api/resources/devices/simulate/SimulateClient.java new file mode 100644 index 0000000..1a915c9 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/simulate/SimulateClient.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.simulate; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.devices.simulate.requests.SimulateConnectRequest; +import com.seam.api.resources.devices.simulate.requests.SimulateDisconnectRequest; +import com.seam.api.resources.devices.simulate.requests.SimulateRemoveRequest; +import com.seam.api.resources.devices.simulate.types.SimulateConnectResponse; +import com.seam.api.resources.devices.simulate.types.SimulateDisconnectResponse; +import com.seam.api.resources.devices.simulate.types.SimulateRemoveResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SimulateClient { + protected final ClientOptions clientOptions; + + public SimulateClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public SimulateConnectResponse connect(SimulateConnectRequest request) { + return connect(request, null); + } + + public SimulateConnectResponse connect(SimulateConnectRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("devices/simulate/connect") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SimulateConnectResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public SimulateDisconnectResponse disconnect(SimulateDisconnectRequest request) { + return disconnect(request, null); + } + + public SimulateDisconnectResponse disconnect(SimulateDisconnectRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("devices/simulate/disconnect") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SimulateDisconnectResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public SimulateRemoveResponse remove(SimulateRemoveRequest request) { + return remove(request, null); + } + + public SimulateRemoveResponse remove(SimulateRemoveRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("devices/simulate/remove") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SimulateRemoveResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateConnectRequest.java b/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateConnectRequest.java new file mode 100644 index 0000000..38e7ba9 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateConnectRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.simulate.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateConnectRequest.Builder.class) +public final class SimulateConnectRequest { + private final String deviceId; + + private final Map additionalProperties; + + private SimulateConnectRequest(String deviceId, Map additionalProperties) { + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateConnectRequest && equalTo((SimulateConnectRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateConnectRequest other) { + return deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + + Builder from(SimulateConnectRequest other); + } + + public interface _FinalStage { + SimulateConnectRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SimulateConnectRequest other) { + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public SimulateConnectRequest build() { + return new SimulateConnectRequest(deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateDisconnectRequest.java b/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateDisconnectRequest.java new file mode 100644 index 0000000..cc65b3b --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateDisconnectRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.simulate.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateDisconnectRequest.Builder.class) +public final class SimulateDisconnectRequest { + private final String deviceId; + + private final Map additionalProperties; + + private SimulateDisconnectRequest(String deviceId, Map additionalProperties) { + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateDisconnectRequest && equalTo((SimulateDisconnectRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateDisconnectRequest other) { + return deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + + Builder from(SimulateDisconnectRequest other); + } + + public interface _FinalStage { + SimulateDisconnectRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SimulateDisconnectRequest other) { + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public SimulateDisconnectRequest build() { + return new SimulateDisconnectRequest(deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateRemoveRequest.java b/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateRemoveRequest.java new file mode 100644 index 0000000..ff738ab --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/simulate/requests/SimulateRemoveRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.simulate.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateRemoveRequest.Builder.class) +public final class SimulateRemoveRequest { + private final String deviceId; + + private final Map additionalProperties; + + private SimulateRemoveRequest(String deviceId, Map additionalProperties) { + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateRemoveRequest && equalTo((SimulateRemoveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateRemoveRequest other) { + return deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + + Builder from(SimulateRemoveRequest other); + } + + public interface _FinalStage { + SimulateRemoveRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SimulateRemoveRequest other) { + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public SimulateRemoveRequest build() { + return new SimulateRemoveRequest(deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ThermostatsHeatResponse.java b/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateConnectResponse.java similarity index 71% rename from src/main/java/com/seam/api/types/ThermostatsHeatResponse.java rename to src/main/java/com/seam/api/resources/devices/simulate/types/SimulateConnectResponse.java index 3740782..2535afa 100644 --- a/src/main/java/com/seam/api/types/ThermostatsHeatResponse.java +++ b/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateConnectResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.simulate.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -16,13 +16,13 @@ import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ThermostatsHeatResponse.Builder.class) -public final class ThermostatsHeatResponse { +@JsonDeserialize(builder = SimulateConnectResponse.Builder.class) +public final class SimulateConnectResponse { private final boolean ok; private final Map additionalProperties; - private ThermostatsHeatResponse(boolean ok, Map additionalProperties) { + private SimulateConnectResponse(boolean ok, Map additionalProperties) { this.ok = ok; this.additionalProperties = additionalProperties; } @@ -32,10 +32,10 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ThermostatsHeatResponse && equalTo((ThermostatsHeatResponse) other); + return other instanceof SimulateConnectResponse && equalTo((SimulateConnectResponse) other); } @JsonAnyGetter @@ -43,16 +43,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ThermostatsHeatResponse other) { + private boolean equalTo(SimulateConnectResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -64,11 +64,11 @@ public static OkStage builder() { public interface OkStage { _FinalStage ok(boolean ok); - Builder from(ThermostatsHeatResponse other); + Builder from(SimulateConnectResponse other); } public interface _FinalStage { - ThermostatsHeatResponse build(); + SimulateConnectResponse build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -80,22 +80,22 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override - public Builder from(ThermostatsHeatResponse other) { + @java.lang.Override + public Builder from(SimulateConnectResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override - public ThermostatsHeatResponse build() { - return new ThermostatsHeatResponse(ok, additionalProperties); + @java.lang.Override + public SimulateConnectResponse build() { + return new SimulateConnectResponse(ok, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateDisconnectResponse.java b/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateDisconnectResponse.java new file mode 100644 index 0000000..c3326ba --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateDisconnectResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.simulate.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateDisconnectResponse.Builder.class) +public final class SimulateDisconnectResponse { + private final boolean ok; + + private final Map additionalProperties; + + private SimulateDisconnectResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateDisconnectResponse && equalTo((SimulateDisconnectResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateDisconnectResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(SimulateDisconnectResponse other); + } + + public interface _FinalStage { + SimulateDisconnectResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SimulateDisconnectResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public SimulateDisconnectResponse build() { + return new SimulateDisconnectResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateRemoveResponse.java b/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateRemoveResponse.java new file mode 100644 index 0000000..9d7c57e --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/simulate/types/SimulateRemoveResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.simulate.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateRemoveResponse.Builder.class) +public final class SimulateRemoveResponse { + private final boolean ok; + + private final Map additionalProperties; + + private SimulateRemoveResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateRemoveResponse && equalTo((SimulateRemoveResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateRemoveResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(SimulateRemoveResponse other); + } + + public interface _FinalStage { + SimulateRemoveResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SimulateRemoveResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public SimulateRemoveResponse build() { + return new SimulateRemoveResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicesDeleteResponse.java b/src/main/java/com/seam/api/resources/devices/types/DevicesDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/DevicesDeleteResponse.java rename to src/main/java/com/seam/api/resources/devices/types/DevicesDeleteResponse.java index 5ce0cac..14ed726 100644 --- a/src/main/java/com/seam/api/types/DevicesDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesDeleteResponse && equalTo((DevicesDeleteResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(DevicesDeleteResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DevicesDeleteResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public DevicesDeleteResponse build() { return new DevicesDeleteResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/DevicesGetResponse.java b/src/main/java/com/seam/api/resources/devices/types/DevicesGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/DevicesGetResponse.java rename to src/main/java/com/seam/api/resources/devices/types/DevicesGetResponse.java index e11a2f0..29e1d6d 100644 --- a/src/main/java/com/seam/api/types/DevicesGetResponse.java +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Device; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesGetResponse && equalTo((DevicesGetResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(DevicesGetResponse other) { return device.equals(other.device) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.device, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements DeviceStage, OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DevicesGetResponse other) { device(other.getDevice()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("device") public OkStage device(Device device) { this.device = device; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public DevicesGetResponse build() { return new DevicesGetResponse(device, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponse.java b/src/main/java/com/seam/api/resources/devices/types/DevicesListDeviceProvidersResponse.java similarity index 63% rename from src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponse.java rename to src/main/java/com/seam/api/resources/devices/types/DevicesListDeviceProvidersResponse.java index 1860926..143ac0d 100644 --- a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponse.java +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesListDeviceProvidersResponse.java @@ -1,8 +1,10 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.types; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -10,24 +12,31 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.DeviceProvider; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = DevicesListDeviceProvidersResponse.Builder.class) public final class DevicesListDeviceProvidersResponse { - private final List deviceProviders; + private final List deviceProviders; private final boolean ok; - private DevicesListDeviceProvidersResponse(List deviceProviders, boolean ok) { + private final Map additionalProperties; + + private DevicesListDeviceProvidersResponse( + List deviceProviders, boolean ok, Map additionalProperties) { this.deviceProviders = deviceProviders; this.ok = ok; + this.additionalProperties = additionalProperties; } @JsonProperty("device_providers") - public List getDeviceProviders() { + public List getDeviceProviders() { return deviceProviders; } @@ -36,23 +45,28 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesListDeviceProvidersResponse && equalTo((DevicesListDeviceProvidersResponse) other); } + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + private boolean equalTo(DevicesListDeviceProvidersResponse other) { return deviceProviders.equals(other.deviceProviders) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceProviders, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -70,58 +84,61 @@ public interface OkStage { public interface _FinalStage { DevicesListDeviceProvidersResponse build(); - _FinalStage deviceProviders(List deviceProviders); + _FinalStage deviceProviders(List deviceProviders); - _FinalStage addDeviceProviders(DeviceListProvider deviceProviders); + _FinalStage addDeviceProviders(DeviceProvider deviceProviders); - _FinalStage addAllDeviceProviders(List deviceProviders); + _FinalStage addAllDeviceProviders(List deviceProviders); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements OkStage, _FinalStage { private boolean ok; - private List deviceProviders = new ArrayList<>(); + private List deviceProviders = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(DevicesListDeviceProvidersResponse other) { deviceProviders(other.getDeviceProviders()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override - public _FinalStage addAllDeviceProviders(List deviceProviders) { + @java.lang.Override + public _FinalStage addAllDeviceProviders(List deviceProviders) { this.deviceProviders.addAll(deviceProviders); return this; } - @Override - public _FinalStage addDeviceProviders(DeviceListProvider deviceProviders) { + @java.lang.Override + public _FinalStage addDeviceProviders(DeviceProvider deviceProviders) { this.deviceProviders.add(deviceProviders); return this; } - @Override + @java.lang.Override @JsonSetter(value = "device_providers", nulls = Nulls.SKIP) - public _FinalStage deviceProviders(List deviceProviders) { + public _FinalStage deviceProviders(List deviceProviders) { this.deviceProviders.clear(); this.deviceProviders.addAll(deviceProviders); return this; } - @Override + @java.lang.Override public DevicesListDeviceProvidersResponse build() { - return new DevicesListDeviceProvidersResponse(deviceProviders, ok); + return new DevicesListDeviceProvidersResponse(deviceProviders, ok, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestCustomMetadataHasValue.java b/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestCustomMetadataHasValue.java new file mode 100644 index 0000000..5bd65a4 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestCustomMetadataHasValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DevicesListRequestCustomMetadataHasValue.Deserializer.class) +public final class DevicesListRequestCustomMetadataHasValue { + private final Object value; + + private final int type; + + private DevicesListRequestCustomMetadataHasValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicesListRequestCustomMetadataHasValue + && equalTo((DevicesListRequestCustomMetadataHasValue) other); + } + + private boolean equalTo(DevicesListRequestCustomMetadataHasValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DevicesListRequestCustomMetadataHasValue of(String value) { + return new DevicesListRequestCustomMetadataHasValue(value, 0); + } + + public static DevicesListRequestCustomMetadataHasValue of(boolean value) { + return new DevicesListRequestCustomMetadataHasValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DevicesListRequestCustomMetadataHasValue.class); + } + + @java.lang.Override + public DevicesListRequestCustomMetadataHasValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestExcludeIfItem.java b/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestExcludeIfItem.java new file mode 100644 index 0000000..0bec403 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestExcludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DevicesListRequestExcludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + DevicesListRequestExcludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestIncludeIfItem.java b/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestIncludeIfItem.java new file mode 100644 index 0000000..e117598 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesListRequestIncludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DevicesListRequestIncludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + DevicesListRequestIncludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/DevicesListResponse.java b/src/main/java/com/seam/api/resources/devices/types/DevicesListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/DevicesListResponse.java rename to src/main/java/com/seam/api/resources/devices/types/DevicesListResponse.java index 24700f8..4bcdbe2 100644 --- a/src/main/java/com/seam/api/types/DevicesListResponse.java +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Device; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -43,7 +44,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesListResponse && equalTo((DevicesListResponse) other); @@ -58,12 +59,12 @@ private boolean equalTo(DevicesListResponse other) { return devices.equals(other.devices) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.devices, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,33 +100,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DevicesListResponse other) { devices(other.getDevices()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllDevices(List devices) { this.devices.addAll(devices); return this; } - @Override + @java.lang.Override public _FinalStage addDevices(Device devices) { this.devices.add(devices); return this; } - @Override + @java.lang.Override @JsonSetter(value = "devices", nulls = Nulls.SKIP) public _FinalStage devices(List devices) { this.devices.clear(); @@ -133,7 +134,7 @@ public _FinalStage devices(List devices) { return this; } - @Override + @java.lang.Override public DevicesListResponse build() { return new DevicesListResponse(devices, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/devices/types/DevicesUpdateRequestCustomMetadataValue.java b/src/main/java/com/seam/api/resources/devices/types/DevicesUpdateRequestCustomMetadataValue.java new file mode 100644 index 0000000..8205514 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesUpdateRequestCustomMetadataValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DevicesUpdateRequestCustomMetadataValue.Deserializer.class) +public final class DevicesUpdateRequestCustomMetadataValue { + private final Object value; + + private final int type; + + private DevicesUpdateRequestCustomMetadataValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicesUpdateRequestCustomMetadataValue + && equalTo((DevicesUpdateRequestCustomMetadataValue) other); + } + + private boolean equalTo(DevicesUpdateRequestCustomMetadataValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DevicesUpdateRequestCustomMetadataValue of(String value) { + return new DevicesUpdateRequestCustomMetadataValue(value, 0); + } + + public static DevicesUpdateRequestCustomMetadataValue of(boolean value) { + return new DevicesUpdateRequestCustomMetadataValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DevicesUpdateRequestCustomMetadataValue.class); + } + + @java.lang.Override + public DevicesUpdateRequestCustomMetadataValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicesUpdateRequestProperties.java b/src/main/java/com/seam/api/resources/devices/types/DevicesUpdateRequestProperties.java similarity index 95% rename from src/main/java/com/seam/api/types/DevicesUpdateRequestProperties.java rename to src/main/java/com/seam/api/resources/devices/types/DevicesUpdateRequestProperties.java index 0318b75..6f6fd85 100644 --- a/src/main/java/com/seam/api/types/DevicesUpdateRequestProperties.java +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesUpdateRequestProperties.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -34,7 +34,7 @@ public Optional getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesUpdateRequestProperties && equalTo((DevicesUpdateRequestProperties) other); @@ -49,12 +49,12 @@ private boolean equalTo(DevicesUpdateRequestProperties other) { return name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/types/DevicesUpdateResponse.java b/src/main/java/com/seam/api/resources/devices/types/DevicesUpdateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/DevicesUpdateResponse.java rename to src/main/java/com/seam/api/resources/devices/types/DevicesUpdateResponse.java index 3e17af0..af69854 100644 --- a/src/main/java/com/seam/api/types/DevicesUpdateResponse.java +++ b/src/main/java/com/seam/api/resources/devices/types/DevicesUpdateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicesUpdateResponse && equalTo((DevicesUpdateResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(DevicesUpdateResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(DevicesUpdateResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public DevicesUpdateResponse build() { return new DevicesUpdateResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/UnmanagedClient.java b/src/main/java/com/seam/api/resources/devices/unmanaged/UnmanagedClient.java index 177dbe5..2643d33 100644 --- a/src/main/java/com/seam/api/resources/devices/unmanaged/UnmanagedClient.java +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/UnmanagedClient.java @@ -3,21 +3,31 @@ */ package com.seam.api.resources.devices.unmanaged; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.devices.unmanaged.requests.UnmanagedGetRequest; import com.seam.api.resources.devices.unmanaged.requests.UnmanagedListRequest; import com.seam.api.resources.devices.unmanaged.requests.UnmanagedUpdateRequest; -import com.seam.api.types.UnmanagedListResponse; -import com.seam.api.types.UnmanagedUpdateResponse; +import com.seam.api.resources.devices.unmanaged.types.UnmanagedGetResponse; +import com.seam.api.resources.devices.unmanaged.types.UnmanagedListResponse; +import com.seam.api.resources.devices.unmanaged.types.UnmanagedUpdateResponse; +import com.seam.api.types.UnmanagedDevice; import java.io.IOException; +import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class UnmanagedClient { protected final ClientOptions clientOptions; @@ -26,21 +36,25 @@ public UnmanagedClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public UnmanagedListResponse list() { - return list(UnmanagedListRequest.builder().build()); + public UnmanagedDevice get() { + return get(UnmanagedGetRequest.builder().build()); + } + + public UnmanagedDevice get(UnmanagedGetRequest request) { + return get(request, null); } - public UnmanagedListResponse list(UnmanagedListRequest request, RequestOptions requestOptions) { + public UnmanagedDevice get(UnmanagedGetRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("devices/unmanaged/list") + .addPathSegments("devices/unmanaged/get") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -48,35 +62,58 @@ public UnmanagedListResponse list(UnmanagedListRequest request, RequestOptions r .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), UnmanagedListResponse.class); + UnmanagedGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UnmanagedGetResponse.class); + return parsedResponse.getDevice(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public UnmanagedListResponse list(UnmanagedListRequest request) { + public List list() { + return list(UnmanagedListRequest.builder().build()); + } + + public List list(UnmanagedListRequest request) { return list(request, null); } - public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request, RequestOptions requestOptions) { + public List list(UnmanagedListRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("devices/unmanaged/update") + .addPathSegments("devices/unmanaged/list") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -84,21 +121,89 @@ public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request, RequestOpt .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), UnmanagedUpdateResponse.class); + UnmanagedListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UnmanagedListResponse.class); + return parsedResponse.getDevices(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request) { return update(request, null); } + + public UnmanagedUpdateResponse update(UnmanagedUpdateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("devices/unmanaged/update") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UnmanagedUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } } diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedGetRequest.java b/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedGetRequest.java new file mode 100644 index 0000000..d1cad55 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedGetRequest.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.unmanaged.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedGetRequest.Builder.class) +public final class UnmanagedGetRequest { + private final Optional deviceId; + + private final Optional name; + + private final Map additionalProperties; + + private UnmanagedGetRequest( + Optional deviceId, Optional name, Map additionalProperties) { + this.deviceId = deviceId; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public Optional getDeviceId() { + return deviceId; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedGetRequest && equalTo((UnmanagedGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedGetRequest other) { + return deviceId.equals(other.deviceId) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional deviceId = Optional.empty(); + + private Optional name = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UnmanagedGetRequest other) { + deviceId(other.getDeviceId()); + name(other.getName()); + return this; + } + + @JsonSetter(value = "device_id", nulls = Nulls.SKIP) + public Builder deviceId(Optional deviceId) { + this.deviceId = deviceId; + return this; + } + + public Builder deviceId(String deviceId) { + this.deviceId = Optional.of(deviceId); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.of(name); + return this; + } + + public UnmanagedGetRequest build() { + return new UnmanagedGetRequest(deviceId, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedListRequest.java b/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedListRequest.java index 026c20d..8500834 100644 --- a/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedListRequest.java +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedListRequest.java @@ -12,6 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.devices.unmanaged.types.UnmanagedListRequestCustomMetadataHasValue; +import com.seam.api.resources.devices.unmanaged.types.UnmanagedListRequestExcludeIfItem; +import com.seam.api.resources.devices.unmanaged.types.UnmanagedListRequestIncludeIfItem; import com.seam.api.types.DeviceType; import com.seam.api.types.Manufacturer; import java.time.OffsetDateTime; @@ -42,6 +45,14 @@ public final class UnmanagedListRequest { private final Optional createdBefore; + private final Optional userIdentifierKey; + + private final Optional> customMetadataHas; + + private final Optional> includeIf; + + private final Optional> excludeIf; + private final Map additionalProperties; private UnmanagedListRequest( @@ -54,6 +65,10 @@ private UnmanagedListRequest( Optional> deviceIds, Optional limit, Optional createdBefore, + Optional userIdentifierKey, + Optional> customMetadataHas, + Optional> includeIf, + Optional> excludeIf, Map additionalProperties) { this.connectedAccountId = connectedAccountId; this.connectedAccountIds = connectedAccountIds; @@ -64,9 +79,16 @@ private UnmanagedListRequest( this.deviceIds = deviceIds; this.limit = limit; this.createdBefore = createdBefore; + this.userIdentifierKey = userIdentifierKey; + this.customMetadataHas = customMetadataHas; + this.includeIf = includeIf; + this.excludeIf = excludeIf; this.additionalProperties = additionalProperties; } + /** + * @return List all devices owned by this connected account + */ @JsonProperty("connected_account_id") public Optional getConnectedAccountId() { return connectedAccountId; @@ -112,7 +134,27 @@ public Optional getCreatedBefore() { return createdBefore; } - @Override + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @JsonProperty("custom_metadata_has") + public Optional> getCustomMetadataHas() { + return customMetadataHas; + } + + @JsonProperty("include_if") + public Optional> getIncludeIf() { + return includeIf; + } + + @JsonProperty("exclude_if") + public Optional> getExcludeIf() { + return excludeIf; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedListRequest && equalTo((UnmanagedListRequest) other); @@ -132,10 +174,14 @@ private boolean equalTo(UnmanagedListRequest other) { && manufacturer.equals(other.manufacturer) && deviceIds.equals(other.deviceIds) && limit.equals(other.limit) - && createdBefore.equals(other.createdBefore); + && createdBefore.equals(other.createdBefore) + && userIdentifierKey.equals(other.userIdentifierKey) + && customMetadataHas.equals(other.customMetadataHas) + && includeIf.equals(other.includeIf) + && excludeIf.equals(other.excludeIf); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectedAccountId, @@ -146,10 +192,14 @@ public int hashCode() { this.manufacturer, this.deviceIds, this.limit, - this.createdBefore); + this.createdBefore, + this.userIdentifierKey, + this.customMetadataHas, + this.includeIf, + this.excludeIf); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -178,6 +228,14 @@ public static final class Builder { private Optional createdBefore = Optional.empty(); + private Optional userIdentifierKey = Optional.empty(); + + private Optional> customMetadataHas = Optional.empty(); + + private Optional> includeIf = Optional.empty(); + + private Optional> excludeIf = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -193,6 +251,10 @@ public Builder from(UnmanagedListRequest other) { deviceIds(other.getDeviceIds()); limit(other.getLimit()); createdBefore(other.getCreatedBefore()); + userIdentifierKey(other.getUserIdentifierKey()); + customMetadataHas(other.getCustomMetadataHas()); + includeIf(other.getIncludeIf()); + excludeIf(other.getExcludeIf()); return this; } @@ -295,6 +357,51 @@ public Builder createdBefore(OffsetDateTime createdBefore) { return this; } + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public Builder userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + public Builder userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @JsonSetter(value = "custom_metadata_has", nulls = Nulls.SKIP) + public Builder customMetadataHas( + Optional> customMetadataHas) { + this.customMetadataHas = customMetadataHas; + return this; + } + + public Builder customMetadataHas(Map customMetadataHas) { + this.customMetadataHas = Optional.of(customMetadataHas); + return this; + } + + @JsonSetter(value = "include_if", nulls = Nulls.SKIP) + public Builder includeIf(Optional> includeIf) { + this.includeIf = includeIf; + return this; + } + + public Builder includeIf(List includeIf) { + this.includeIf = Optional.of(includeIf); + return this; + } + + @JsonSetter(value = "exclude_if", nulls = Nulls.SKIP) + public Builder excludeIf(Optional> excludeIf) { + this.excludeIf = excludeIf; + return this; + } + + public Builder excludeIf(List excludeIf) { + this.excludeIf = Optional.of(excludeIf); + return this; + } + public UnmanagedListRequest build() { return new UnmanagedListRequest( connectedAccountId, @@ -306,6 +413,10 @@ public UnmanagedListRequest build() { deviceIds, limit, createdBefore, + userIdentifierKey, + customMetadataHas, + includeIf, + excludeIf, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedUpdateRequest.java b/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedUpdateRequest.java index 1c22272..c39265a 100644 --- a/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedUpdateRequest.java +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/requests/UnmanagedUpdateRequest.java @@ -40,7 +40,7 @@ public boolean getIsManaged() { return isManaged; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedUpdateRequest && equalTo((UnmanagedUpdateRequest) other); @@ -55,12 +55,12 @@ private boolean equalTo(UnmanagedUpdateRequest other) { return deviceId.equals(other.deviceId) && isManaged == other.isManaged; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.isManaged); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +94,28 @@ public static final class Builder implements DeviceIdStage, IsManagedStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedUpdateRequest other) { deviceId(other.getDeviceId()); isManaged(other.getIsManaged()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public IsManagedStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("is_managed") public _FinalStage isManaged(boolean isManaged) { this.isManaged = isManaged; return this; } - @Override + @java.lang.Override public UnmanagedUpdateRequest build() { return new UnmanagedUpdateRequest(deviceId, isManaged, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedGetResponse.java b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedGetResponse.java new file mode 100644 index 0000000..1a1de01 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedGetResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.unmanaged.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UnmanagedDevice; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedGetResponse.Builder.class) +public final class UnmanagedGetResponse { + private final UnmanagedDevice device; + + private final boolean ok; + + private final Map additionalProperties; + + private UnmanagedGetResponse(UnmanagedDevice device, boolean ok, Map additionalProperties) { + this.device = device; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device") + public UnmanagedDevice getDevice() { + return device; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedGetResponse && equalTo((UnmanagedGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedGetResponse other) { + return device.equals(other.device) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.device, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceStage builder() { + return new Builder(); + } + + public interface DeviceStage { + OkStage device(UnmanagedDevice device); + + Builder from(UnmanagedGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + UnmanagedGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceStage, OkStage, _FinalStage { + private UnmanagedDevice device; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UnmanagedGetResponse other) { + device(other.getDevice()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("device") + public OkStage device(UnmanagedDevice device) { + this.device = device; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UnmanagedGetResponse build() { + return new UnmanagedGetResponse(device, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestCustomMetadataHasValue.java b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestCustomMetadataHasValue.java new file mode 100644 index 0000000..320e1af --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestCustomMetadataHasValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.unmanaged.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UnmanagedListRequestCustomMetadataHasValue.Deserializer.class) +public final class UnmanagedListRequestCustomMetadataHasValue { + private final Object value; + + private final int type; + + private UnmanagedListRequestCustomMetadataHasValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedListRequestCustomMetadataHasValue + && equalTo((UnmanagedListRequestCustomMetadataHasValue) other); + } + + private boolean equalTo(UnmanagedListRequestCustomMetadataHasValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UnmanagedListRequestCustomMetadataHasValue of(String value) { + return new UnmanagedListRequestCustomMetadataHasValue(value, 0); + } + + public static UnmanagedListRequestCustomMetadataHasValue of(boolean value) { + return new UnmanagedListRequestCustomMetadataHasValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UnmanagedListRequestCustomMetadataHasValue.class); + } + + @java.lang.Override + public UnmanagedListRequestCustomMetadataHasValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestExcludeIfItem.java b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestExcludeIfItem.java new file mode 100644 index 0000000..1077773 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestExcludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.unmanaged.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UnmanagedListRequestExcludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + UnmanagedListRequestExcludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestIncludeIfItem.java b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestIncludeIfItem.java new file mode 100644 index 0000000..38a0857 --- /dev/null +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListRequestIncludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.devices.unmanaged.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UnmanagedListRequestIncludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + UnmanagedListRequestIncludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedListResponse.java b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListResponse.java similarity index 91% rename from src/main/java/com/seam/api/types/UnmanagedListResponse.java rename to src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListResponse.java index dae9e2e..3f10f7e 100644 --- a/src/main/java/com/seam/api/types/UnmanagedListResponse.java +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.unmanaged.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UnmanagedDevice; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -43,7 +44,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedListResponse && equalTo((UnmanagedListResponse) other); @@ -58,12 +59,12 @@ private boolean equalTo(UnmanagedListResponse other) { return devices.equals(other.devices) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.devices, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,33 +100,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedListResponse other) { devices(other.getDevices()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllDevices(List devices) { this.devices.addAll(devices); return this; } - @Override + @java.lang.Override public _FinalStage addDevices(UnmanagedDevice devices) { this.devices.add(devices); return this; } - @Override + @java.lang.Override @JsonSetter(value = "devices", nulls = Nulls.SKIP) public _FinalStage devices(List devices) { this.devices.clear(); @@ -133,7 +134,7 @@ public _FinalStage devices(List devices) { return this; } - @Override + @java.lang.Override public UnmanagedListResponse build() { return new UnmanagedListResponse(devices, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/UnmanagedUpdateResponse.java b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedUpdateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/UnmanagedUpdateResponse.java rename to src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedUpdateResponse.java index 492874c..84b7868 100644 --- a/src/main/java/com/seam/api/types/UnmanagedUpdateResponse.java +++ b/src/main/java/com/seam/api/resources/devices/unmanaged/types/UnmanagedUpdateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.devices.unmanaged.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedUpdateResponse && equalTo((UnmanagedUpdateResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(UnmanagedUpdateResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedUpdateResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public UnmanagedUpdateResponse build() { return new UnmanagedUpdateResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/events/EventsClient.java b/src/main/java/com/seam/api/resources/events/EventsClient.java index 9f7acba..16c24d2 100644 --- a/src/main/java/com/seam/api/resources/events/EventsClient.java +++ b/src/main/java/com/seam/api/resources/events/EventsClient.java @@ -3,25 +3,30 @@ */ package com.seam.api.resources.events; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.events.requests.EventsGetRequest; import com.seam.api.resources.events.requests.EventsListRequest; +import com.seam.api.resources.events.types.EventsGetResponse; +import com.seam.api.resources.events.types.EventsListResponse; import com.seam.api.types.Event; -import com.seam.api.types.EventsGetResponse; -import com.seam.api.types.EventsListResponse; import java.io.IOException; -import java.util.Collections; import java.util.List; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class EventsClient { protected final ClientOptions clientOptions; @@ -30,6 +35,10 @@ public EventsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + public Optional get() { + return get(EventsGetRequest.builder().build()); + } + public Optional get(EventsGetRequest request) { return get(request, null); } @@ -42,9 +51,9 @@ public Optional get(EventsGetRequest request, RequestOptions requestOptio RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -52,24 +61,41 @@ public Optional get(EventsGetRequest request, RequestOptions requestOptio .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { EventsGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), EventsGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EventsGetResponse.class); return parsedResponse.getEvent(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public Optional get() { - return get(EventsGetRequest.builder().build()); + public List list() { + return list(EventsListRequest.builder().build()); } public List list(EventsListRequest request) { @@ -84,9 +110,9 @@ public List list(EventsListRequest request, RequestOptions requestOptions RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -94,23 +120,36 @@ public List list(EventsListRequest request, RequestOptions requestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { EventsListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), EventsListResponse.class); - return parsedResponse.getEvents().orElse(Collections.emptyList()); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EventsListResponse.class); + return parsedResponse.getEvents(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - - public List list() { - return list(EventsListRequest.builder().build()); - } } diff --git a/src/main/java/com/seam/api/resources/events/requests/EventsGetRequest.java b/src/main/java/com/seam/api/resources/events/requests/EventsGetRequest.java index 2579c01..2220464 100644 --- a/src/main/java/com/seam/api/resources/events/requests/EventsGetRequest.java +++ b/src/main/java/com/seam/api/resources/events/requests/EventsGetRequest.java @@ -54,7 +54,7 @@ public Optional getDeviceId() { return deviceId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventsGetRequest && equalTo((EventsGetRequest) other); @@ -69,12 +69,12 @@ private boolean equalTo(EventsGetRequest other) { return eventId.equals(other.eventId) && eventType.equals(other.eventType) && deviceId.equals(other.deviceId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.eventId, this.eventType, this.deviceId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/resources/events/requests/EventsListRequest.java b/src/main/java/com/seam/api/resources/events/requests/EventsListRequest.java index 9c44091..edba176 100644 --- a/src/main/java/com/seam/api/resources/events/requests/EventsListRequest.java +++ b/src/main/java/com/seam/api/resources/events/requests/EventsListRequest.java @@ -12,9 +12,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.EventsListRequestBetweenItem; -import com.seam.api.types.EventsListRequestEventType; -import com.seam.api.types.EventsListRequestEventTypesItem; +import com.seam.api.resources.events.types.EventsListRequestBetweenItem; +import com.seam.api.types.EventType; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,12 +35,14 @@ public final class EventsListRequest { private final Optional> accessCodeIds; - private final Optional eventType; + private final Optional eventType; - private final Optional> eventTypes; + private final Optional> eventTypes; private final Optional connectedAccountId; + private final Optional limit; + private final Map additionalProperties; private EventsListRequest( @@ -51,9 +52,10 @@ private EventsListRequest( Optional> deviceIds, Optional accessCodeId, Optional> accessCodeIds, - Optional eventType, - Optional> eventTypes, + Optional eventType, + Optional> eventTypes, Optional connectedAccountId, + Optional limit, Map additionalProperties) { this.since = since; this.between = between; @@ -64,6 +66,7 @@ private EventsListRequest( this.eventType = eventType; this.eventTypes = eventTypes; this.connectedAccountId = connectedAccountId; + this.limit = limit; this.additionalProperties = additionalProperties; } @@ -98,12 +101,12 @@ public Optional> getAccessCodeIds() { } @JsonProperty("event_type") - public Optional getEventType() { + public Optional getEventType() { return eventType; } @JsonProperty("event_types") - public Optional> getEventTypes() { + public Optional> getEventTypes() { return eventTypes; } @@ -112,7 +115,12 @@ public Optional getConnectedAccountId() { return connectedAccountId; } - @Override + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventsListRequest && equalTo((EventsListRequest) other); @@ -132,10 +140,11 @@ private boolean equalTo(EventsListRequest other) { && accessCodeIds.equals(other.accessCodeIds) && eventType.equals(other.eventType) && eventTypes.equals(other.eventTypes) - && connectedAccountId.equals(other.connectedAccountId); + && connectedAccountId.equals(other.connectedAccountId) + && limit.equals(other.limit); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.since, @@ -146,10 +155,11 @@ public int hashCode() { this.accessCodeIds, this.eventType, this.eventTypes, - this.connectedAccountId); + this.connectedAccountId, + this.limit); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -172,12 +182,14 @@ public static final class Builder { private Optional> accessCodeIds = Optional.empty(); - private Optional eventType = Optional.empty(); + private Optional eventType = Optional.empty(); - private Optional> eventTypes = Optional.empty(); + private Optional> eventTypes = Optional.empty(); private Optional connectedAccountId = Optional.empty(); + private Optional limit = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -193,6 +205,7 @@ public Builder from(EventsListRequest other) { eventType(other.getEventType()); eventTypes(other.getEventTypes()); connectedAccountId(other.getConnectedAccountId()); + limit(other.getLimit()); return this; } @@ -263,23 +276,23 @@ public Builder accessCodeIds(List accessCodeIds) { } @JsonSetter(value = "event_type", nulls = Nulls.SKIP) - public Builder eventType(Optional eventType) { + public Builder eventType(Optional eventType) { this.eventType = eventType; return this; } - public Builder eventType(EventsListRequestEventType eventType) { + public Builder eventType(EventType eventType) { this.eventType = Optional.of(eventType); return this; } @JsonSetter(value = "event_types", nulls = Nulls.SKIP) - public Builder eventTypes(Optional> eventTypes) { + public Builder eventTypes(Optional> eventTypes) { this.eventTypes = eventTypes; return this; } - public Builder eventTypes(List eventTypes) { + public Builder eventTypes(List eventTypes) { this.eventTypes = Optional.of(eventTypes); return this; } @@ -295,6 +308,17 @@ public Builder connectedAccountId(String connectedAccountId) { return this; } + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Double limit) { + this.limit = Optional.of(limit); + return this; + } + public EventsListRequest build() { return new EventsListRequest( since, @@ -306,6 +330,7 @@ public EventsListRequest build() { eventType, eventTypes, connectedAccountId, + limit, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/EventsGetResponse.java b/src/main/java/com/seam/api/resources/events/types/EventsGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/EventsGetResponse.java rename to src/main/java/com/seam/api/resources/events/types/EventsGetResponse.java index bf8642a..2def05f 100644 --- a/src/main/java/com/seam/api/types/EventsGetResponse.java +++ b/src/main/java/com/seam/api/resources/events/types/EventsGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.events.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Event; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -51,7 +52,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventsGetResponse && equalTo((EventsGetResponse) other); @@ -66,12 +67,12 @@ private boolean equalTo(EventsGetResponse other) { return event.equals(other.event) && message.equals(other.message) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.event, this.message, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -111,7 +112,7 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(EventsGetResponse other) { event(other.getEvent()); message(other.getMessage()); @@ -119,40 +120,40 @@ public Builder from(EventsGetResponse other) { return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage message(String message) { this.message = Optional.of(message); return this; } - @Override + @java.lang.Override @JsonSetter(value = "message", nulls = Nulls.SKIP) public _FinalStage message(Optional message) { this.message = message; return this; } - @Override + @java.lang.Override public _FinalStage event(Event event) { this.event = Optional.of(event); return this; } - @Override + @java.lang.Override @JsonSetter(value = "event", nulls = Nulls.SKIP) public _FinalStage event(Optional event) { this.event = event; return this; } - @Override + @java.lang.Override public EventsGetResponse build() { return new EventsGetResponse(event, message, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/EventsListRequestBetweenItem.java b/src/main/java/com/seam/api/resources/events/types/EventsListRequestBetweenItem.java similarity index 95% rename from src/main/java/com/seam/api/types/EventsListRequestBetweenItem.java rename to src/main/java/com/seam/api/resources/events/types/EventsListRequestBetweenItem.java index 7ec1320..bfac1e2 100644 --- a/src/main/java/com/seam/api/types/EventsListRequestBetweenItem.java +++ b/src/main/java/com/seam/api/resources/events/types/EventsListRequestBetweenItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.events.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -39,7 +39,7 @@ public T visit(Visitor visitor) { throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventsListRequestBetweenItem && equalTo((EventsListRequestBetweenItem) other); @@ -49,12 +49,12 @@ private boolean equalTo(EventsListRequestBetweenItem other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -78,7 +78,7 @@ static final class Deserializer extends StdDeserializer> events; - - private final Optional message; + private final List events; private final boolean ok; private final Map additionalProperties; - private EventsListResponse( - Optional> events, - Optional message, - boolean ok, - Map additionalProperties) { + private EventsListResponse(List events, boolean ok, Map additionalProperties) { this.events = events; - this.message = message; this.ok = ok; this.additionalProperties = additionalProperties; } @JsonProperty("events") - public Optional> getEvents() { + public List getEvents() { return events; } - @JsonProperty("message") - public Optional getMessage() { - return message; - } - @JsonProperty("ok") public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof EventsListResponse && equalTo((EventsListResponse) other); @@ -67,15 +56,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(EventsListResponse other) { - return events.equals(other.events) && message.equals(other.message) && ok == other.ok; + return events.equals(other.events) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.events, this.message, this.ok); + return Objects.hash(this.events, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -93,72 +82,61 @@ public interface OkStage { public interface _FinalStage { EventsListResponse build(); - _FinalStage events(Optional> events); - _FinalStage events(List events); - _FinalStage message(Optional message); + _FinalStage addEvents(Event events); - _FinalStage message(String message); + _FinalStage addAllEvents(List events); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements OkStage, _FinalStage { private boolean ok; - private Optional message = Optional.empty(); - - private Optional> events = Optional.empty(); + private List events = new ArrayList<>(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(EventsListResponse other) { events(other.getEvents()); - message(other.getMessage()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override - public _FinalStage message(String message) { - this.message = Optional.of(message); + @java.lang.Override + public _FinalStage addAllEvents(List events) { + this.events.addAll(events); return this; } - @Override - @JsonSetter(value = "message", nulls = Nulls.SKIP) - public _FinalStage message(Optional message) { - this.message = message; + @java.lang.Override + public _FinalStage addEvents(Event events) { + this.events.add(events); return this; } - @Override - public _FinalStage events(List events) { - this.events = Optional.of(events); - return this; - } - - @Override + @java.lang.Override @JsonSetter(value = "events", nulls = Nulls.SKIP) - public _FinalStage events(Optional> events) { - this.events = events; + public _FinalStage events(List events) { + this.events.clear(); + this.events.addAll(events); return this; } - @Override + @java.lang.Override public EventsListResponse build() { - return new EventsListResponse(events, message, ok, additionalProperties); + return new EventsListResponse(events, ok, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/health/HealthClient.java b/src/main/java/com/seam/api/resources/health/HealthClient.java deleted file mode 100644 index 97b9940..0000000 --- a/src/main/java/com/seam/api/resources/health/HealthClient.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.resources.health; - -import com.seam.api.core.ApiError; -import com.seam.api.core.ClientOptions; -import com.seam.api.core.ObjectMappers; -import com.seam.api.core.RequestOptions; -import com.seam.api.core.Suppliers; -import com.seam.api.resources.health.requests.HealthGetServiceHealthRequest; -import com.seam.api.resources.health.service.ServiceClient; -import com.seam.api.types.HealthGetHealthResponse; -import com.seam.api.types.HealthGetServiceHealthResponse; -import java.io.IOException; -import java.util.function.Supplier; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class HealthClient { - protected final ClientOptions clientOptions; - - protected final Supplier serviceClient; - - public HealthClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.serviceClient = Suppliers.memoize(() -> new ServiceClient(clientOptions)); - } - - public HealthGetHealthResponse getHealth(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("health/get_health") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); - if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), HealthGetHealthResponse.class); - } - throw new ApiError( - response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public HealthGetHealthResponse getHealth() { - return getHealth(null); - } - - public HealthGetServiceHealthResponse getServiceHealth( - HealthGetServiceHealthRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("health/get_service_health") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); - if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), HealthGetServiceHealthResponse.class); - } - throw new ApiError( - response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public HealthGetServiceHealthResponse getServiceHealth(HealthGetServiceHealthRequest request) { - return getServiceHealth(request, null); - } - - public ServiceClient service() { - return this.serviceClient.get(); - } -} diff --git a/src/main/java/com/seam/api/resources/health/requests/HealthGetServiceHealthRequest.java b/src/main/java/com/seam/api/resources/health/requests/HealthGetServiceHealthRequest.java deleted file mode 100644 index c75133b..0000000 --- a/src/main/java/com/seam/api/resources/health/requests/HealthGetServiceHealthRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.resources.health.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = HealthGetServiceHealthRequest.Builder.class) -public final class HealthGetServiceHealthRequest { - private final String service; - - private final Map additionalProperties; - - private HealthGetServiceHealthRequest(String service, Map additionalProperties) { - this.service = service; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("service") - public String getService() { - return service; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof HealthGetServiceHealthRequest && equalTo((HealthGetServiceHealthRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(HealthGetServiceHealthRequest other) { - return service.equals(other.service); - } - - @Override - public int hashCode() { - return Objects.hash(this.service); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ServiceStage builder() { - return new Builder(); - } - - public interface ServiceStage { - _FinalStage service(String service); - - Builder from(HealthGetServiceHealthRequest other); - } - - public interface _FinalStage { - HealthGetServiceHealthRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ServiceStage, _FinalStage { - private String service; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(HealthGetServiceHealthRequest other) { - service(other.getService()); - return this; - } - - @Override - @JsonSetter("service") - public _FinalStage service(String service) { - this.service = service; - return this; - } - - @Override - public HealthGetServiceHealthRequest build() { - return new HealthGetServiceHealthRequest(service, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/resources/health/service/ServiceClient.java b/src/main/java/com/seam/api/resources/health/service/ServiceClient.java deleted file mode 100644 index 3e5cdcf..0000000 --- a/src/main/java/com/seam/api/resources/health/service/ServiceClient.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.resources.health.service; - -import com.seam.api.core.ApiError; -import com.seam.api.core.ClientOptions; -import com.seam.api.core.ObjectMappers; -import com.seam.api.core.RequestOptions; -import com.seam.api.resources.health.service.requests.ServiceByServiceNameRequest; -import com.seam.api.types.ServiceByServiceNameResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -public class ServiceClient { - protected final ClientOptions clientOptions; - - public ServiceClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public ServiceByServiceNameResponse byServiceName( - ServiceByServiceNameRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("health/service/[service_name]") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); - if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ServiceByServiceNameResponse.class); - } - throw new ApiError( - response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public ServiceByServiceNameResponse byServiceName(ServiceByServiceNameRequest request) { - return byServiceName(request, null); - } -} diff --git a/src/main/java/com/seam/api/resources/health/service/requests/ServiceByServiceNameRequest.java b/src/main/java/com/seam/api/resources/health/service/requests/ServiceByServiceNameRequest.java deleted file mode 100644 index 680205a..0000000 --- a/src/main/java/com/seam/api/resources/health/service/requests/ServiceByServiceNameRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.resources.health.service.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ServiceByServiceNameRequest.Builder.class) -public final class ServiceByServiceNameRequest { - private final String serviceName; - - private final Map additionalProperties; - - private ServiceByServiceNameRequest(String serviceName, Map additionalProperties) { - this.serviceName = serviceName; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("service_name") - public String getServiceName() { - return serviceName; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ServiceByServiceNameRequest && equalTo((ServiceByServiceNameRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ServiceByServiceNameRequest other) { - return serviceName.equals(other.serviceName); - } - - @Override - public int hashCode() { - return Objects.hash(this.serviceName); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ServiceNameStage builder() { - return new Builder(); - } - - public interface ServiceNameStage { - _FinalStage serviceName(String serviceName); - - Builder from(ServiceByServiceNameRequest other); - } - - public interface _FinalStage { - ServiceByServiceNameRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ServiceNameStage, _FinalStage { - private String serviceName; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(ServiceByServiceNameRequest other) { - serviceName(other.getServiceName()); - return this; - } - - @Override - @JsonSetter("service_name") - public _FinalStage serviceName(String serviceName) { - this.serviceName = serviceName; - return this; - } - - @Override - public ServiceByServiceNameRequest build() { - return new ServiceByServiceNameRequest(serviceName, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/resources/locks/LocksClient.java b/src/main/java/com/seam/api/resources/locks/LocksClient.java index 45aac1a..4156137 100644 --- a/src/main/java/com/seam/api/resources/locks/LocksClient.java +++ b/src/main/java/com/seam/api/resources/locks/LocksClient.java @@ -3,28 +3,34 @@ */ package com.seam.api.resources.locks; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.locks.requests.LocksGetRequest; import com.seam.api.resources.locks.requests.LocksListRequest; import com.seam.api.resources.locks.requests.LocksLockDoorRequest; import com.seam.api.resources.locks.requests.LocksUnlockDoorRequest; +import com.seam.api.resources.locks.types.LocksGetResponse; +import com.seam.api.resources.locks.types.LocksListResponse; +import com.seam.api.resources.locks.types.LocksLockDoorResponse; +import com.seam.api.resources.locks.types.LocksUnlockDoorResponse; import com.seam.api.types.ActionAttempt; import com.seam.api.types.Device; -import com.seam.api.types.LocksGetResponse; -import com.seam.api.types.LocksListResponse; -import com.seam.api.types.LocksLockDoorResponse; -import com.seam.api.types.LocksUnlockDoorResponse; import java.io.IOException; import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class LocksClient { protected final ClientOptions clientOptions; @@ -33,6 +39,10 @@ public LocksClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + public Device get() { + return get(LocksGetRequest.builder().build()); + } + public Device get(LocksGetRequest request) { return get(request, null); } @@ -45,9 +55,9 @@ public Device get(LocksGetRequest request, RequestOptions requestOptions) { RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -55,24 +65,41 @@ public Device get(LocksGetRequest request, RequestOptions requestOptions) { .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { LocksGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LocksGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LocksGetResponse.class); return parsedResponse.getDevice(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public Device get() { - return get(LocksGetRequest.builder().build()); + public List list() { + return list(LocksListRequest.builder().build()); } public List list(LocksListRequest request) { @@ -87,9 +114,9 @@ public List list(LocksListRequest request, RequestOptions requestOptions RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -97,26 +124,39 @@ public List list(LocksListRequest request, RequestOptions requestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { LocksListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LocksListResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LocksListResponse.class); return parsedResponse.getDevices(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public List list() { - return list(LocksListRequest.builder().build()); - } - public ActionAttempt lockDoor(LocksLockDoorRequest request) { return lockDoor(request, null); } @@ -129,9 +169,9 @@ public ActionAttempt lockDoor(LocksLockDoorRequest request, RequestOptions reque RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -139,19 +179,36 @@ public ActionAttempt lockDoor(LocksLockDoorRequest request, RequestOptions reque .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { LocksLockDoorResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LocksLockDoorResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LocksLockDoorResponse.class); return parsedResponse.getActionAttempt(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -167,9 +224,9 @@ public ActionAttempt unlockDoor(LocksUnlockDoorRequest request, RequestOptions r RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -177,19 +234,36 @@ public ActionAttempt unlockDoor(LocksUnlockDoorRequest request, RequestOptions r .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { LocksUnlockDoorResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LocksUnlockDoorResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LocksUnlockDoorResponse.class); return parsedResponse.getActionAttempt(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/seam/api/resources/locks/requests/LocksGetRequest.java b/src/main/java/com/seam/api/resources/locks/requests/LocksGetRequest.java index 6f59053..a944b20 100644 --- a/src/main/java/com/seam/api/resources/locks/requests/LocksGetRequest.java +++ b/src/main/java/com/seam/api/resources/locks/requests/LocksGetRequest.java @@ -43,7 +43,7 @@ public Optional getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksGetRequest && equalTo((LocksGetRequest) other); @@ -58,12 +58,12 @@ private boolean equalTo(LocksGetRequest other) { return deviceId.equals(other.deviceId) && name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/resources/locks/requests/LocksListRequest.java b/src/main/java/com/seam/api/resources/locks/requests/LocksListRequest.java index f6e08a1..fb34495 100644 --- a/src/main/java/com/seam/api/resources/locks/requests/LocksListRequest.java +++ b/src/main/java/com/seam/api/resources/locks/requests/LocksListRequest.java @@ -12,6 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.locks.types.LocksListRequestCustomMetadataHasValue; +import com.seam.api.resources.locks.types.LocksListRequestExcludeIfItem; +import com.seam.api.resources.locks.types.LocksListRequestIncludeIfItem; import com.seam.api.types.DeviceType; import com.seam.api.types.Manufacturer; import java.time.OffsetDateTime; @@ -42,6 +45,14 @@ public final class LocksListRequest { private final Optional createdBefore; + private final Optional userIdentifierKey; + + private final Optional> customMetadataHas; + + private final Optional> includeIf; + + private final Optional> excludeIf; + private final Map additionalProperties; private LocksListRequest( @@ -54,6 +65,10 @@ private LocksListRequest( Optional> deviceIds, Optional limit, Optional createdBefore, + Optional userIdentifierKey, + Optional> customMetadataHas, + Optional> includeIf, + Optional> excludeIf, Map additionalProperties) { this.connectedAccountId = connectedAccountId; this.connectedAccountIds = connectedAccountIds; @@ -64,9 +79,16 @@ private LocksListRequest( this.deviceIds = deviceIds; this.limit = limit; this.createdBefore = createdBefore; + this.userIdentifierKey = userIdentifierKey; + this.customMetadataHas = customMetadataHas; + this.includeIf = includeIf; + this.excludeIf = excludeIf; this.additionalProperties = additionalProperties; } + /** + * @return List all devices owned by this connected account + */ @JsonProperty("connected_account_id") public Optional getConnectedAccountId() { return connectedAccountId; @@ -112,7 +134,27 @@ public Optional getCreatedBefore() { return createdBefore; } - @Override + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @JsonProperty("custom_metadata_has") + public Optional> getCustomMetadataHas() { + return customMetadataHas; + } + + @JsonProperty("include_if") + public Optional> getIncludeIf() { + return includeIf; + } + + @JsonProperty("exclude_if") + public Optional> getExcludeIf() { + return excludeIf; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksListRequest && equalTo((LocksListRequest) other); @@ -132,10 +174,14 @@ private boolean equalTo(LocksListRequest other) { && manufacturer.equals(other.manufacturer) && deviceIds.equals(other.deviceIds) && limit.equals(other.limit) - && createdBefore.equals(other.createdBefore); + && createdBefore.equals(other.createdBefore) + && userIdentifierKey.equals(other.userIdentifierKey) + && customMetadataHas.equals(other.customMetadataHas) + && includeIf.equals(other.includeIf) + && excludeIf.equals(other.excludeIf); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectedAccountId, @@ -146,10 +192,14 @@ public int hashCode() { this.manufacturer, this.deviceIds, this.limit, - this.createdBefore); + this.createdBefore, + this.userIdentifierKey, + this.customMetadataHas, + this.includeIf, + this.excludeIf); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -178,6 +228,14 @@ public static final class Builder { private Optional createdBefore = Optional.empty(); + private Optional userIdentifierKey = Optional.empty(); + + private Optional> customMetadataHas = Optional.empty(); + + private Optional> includeIf = Optional.empty(); + + private Optional> excludeIf = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -193,6 +251,10 @@ public Builder from(LocksListRequest other) { deviceIds(other.getDeviceIds()); limit(other.getLimit()); createdBefore(other.getCreatedBefore()); + userIdentifierKey(other.getUserIdentifierKey()); + customMetadataHas(other.getCustomMetadataHas()); + includeIf(other.getIncludeIf()); + excludeIf(other.getExcludeIf()); return this; } @@ -295,6 +357,51 @@ public Builder createdBefore(OffsetDateTime createdBefore) { return this; } + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public Builder userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + public Builder userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @JsonSetter(value = "custom_metadata_has", nulls = Nulls.SKIP) + public Builder customMetadataHas( + Optional> customMetadataHas) { + this.customMetadataHas = customMetadataHas; + return this; + } + + public Builder customMetadataHas(Map customMetadataHas) { + this.customMetadataHas = Optional.of(customMetadataHas); + return this; + } + + @JsonSetter(value = "include_if", nulls = Nulls.SKIP) + public Builder includeIf(Optional> includeIf) { + this.includeIf = includeIf; + return this; + } + + public Builder includeIf(List includeIf) { + this.includeIf = Optional.of(includeIf); + return this; + } + + @JsonSetter(value = "exclude_if", nulls = Nulls.SKIP) + public Builder excludeIf(Optional> excludeIf) { + this.excludeIf = excludeIf; + return this; + } + + public Builder excludeIf(List excludeIf) { + this.excludeIf = Optional.of(excludeIf); + return this; + } + public LocksListRequest build() { return new LocksListRequest( connectedAccountId, @@ -306,6 +413,10 @@ public LocksListRequest build() { deviceIds, limit, createdBefore, + userIdentifierKey, + customMetadataHas, + includeIf, + excludeIf, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/locks/requests/LocksLockDoorRequest.java b/src/main/java/com/seam/api/resources/locks/requests/LocksLockDoorRequest.java index 6631271..be98935 100644 --- a/src/main/java/com/seam/api/resources/locks/requests/LocksLockDoorRequest.java +++ b/src/main/java/com/seam/api/resources/locks/requests/LocksLockDoorRequest.java @@ -42,7 +42,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksLockDoorRequest && equalTo((LocksLockDoorRequest) other); @@ -57,12 +57,12 @@ private boolean equalTo(LocksLockDoorRequest other) { return deviceId.equals(other.deviceId) && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,34 +96,34 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(LocksLockDoorRequest other) { deviceId(other.getDeviceId()); sync(other.getSync()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public LocksLockDoorRequest build() { return new LocksLockDoorRequest(deviceId, sync, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/locks/requests/LocksUnlockDoorRequest.java b/src/main/java/com/seam/api/resources/locks/requests/LocksUnlockDoorRequest.java index 784c4cd..9642dd9 100644 --- a/src/main/java/com/seam/api/resources/locks/requests/LocksUnlockDoorRequest.java +++ b/src/main/java/com/seam/api/resources/locks/requests/LocksUnlockDoorRequest.java @@ -42,7 +42,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksUnlockDoorRequest && equalTo((LocksUnlockDoorRequest) other); @@ -57,12 +57,12 @@ private boolean equalTo(LocksUnlockDoorRequest other) { return deviceId.equals(other.deviceId) && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,34 +96,34 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(LocksUnlockDoorRequest other) { deviceId(other.getDeviceId()); sync(other.getSync()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public LocksUnlockDoorRequest build() { return new LocksUnlockDoorRequest(deviceId, sync, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/LocksGetResponse.java b/src/main/java/com/seam/api/resources/locks/types/LocksGetResponse.java similarity index 75% rename from src/main/java/com/seam/api/types/LocksGetResponse.java rename to src/main/java/com/seam/api/resources/locks/types/LocksGetResponse.java index 2b048f8..3a15462 100644 --- a/src/main/java/com/seam/api/types/LocksGetResponse.java +++ b/src/main/java/com/seam/api/resources/locks/types/LocksGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.locks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -9,18 +9,17 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Device; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = LocksGetResponse.Builder.class) public final class LocksGetResponse { - private final Optional lock; + private final Device lock; private final Device device; @@ -28,8 +27,7 @@ public final class LocksGetResponse { private final Map additionalProperties; - private LocksGetResponse( - Optional lock, Device device, boolean ok, Map additionalProperties) { + private LocksGetResponse(Device lock, Device device, boolean ok, Map additionalProperties) { this.lock = lock; this.device = device; this.ok = ok; @@ -37,7 +35,7 @@ private LocksGetResponse( } @JsonProperty("lock") - public Optional getLock() { + public Device getLock() { return lock; } @@ -51,7 +49,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksGetResponse && equalTo((LocksGetResponse) other); @@ -66,52 +64,52 @@ private boolean equalTo(LocksGetResponse other) { return lock.equals(other.lock) && device.equals(other.device) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.lock, this.device, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } - public static DeviceStage builder() { + public static LockStage builder() { return new Builder(); } - public interface DeviceStage { - OkStage device(Device device); + public interface LockStage { + DeviceStage lock(Device lock); Builder from(LocksGetResponse other); } + public interface DeviceStage { + OkStage device(Device device); + } + public interface OkStage { _FinalStage ok(boolean ok); } public interface _FinalStage { LocksGetResponse build(); - - _FinalStage lock(Optional lock); - - _FinalStage lock(Object lock); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DeviceStage, OkStage, _FinalStage { + public static final class Builder implements LockStage, DeviceStage, OkStage, _FinalStage { + private Device lock; + private Device device; private boolean ok; - private Optional lock = Optional.empty(); - @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(LocksGetResponse other) { lock(other.getLock()); device(other.getDevice()); @@ -119,34 +117,28 @@ public Builder from(LocksGetResponse other) { return this; } - @Override + @java.lang.Override + @JsonSetter("lock") + public DeviceStage lock(Device lock) { + this.lock = lock; + return this; + } + + @java.lang.Override @JsonSetter("device") public OkStage device(Device device) { this.device = device; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override - public _FinalStage lock(Object lock) { - this.lock = Optional.of(lock); - return this; - } - - @Override - @JsonSetter(value = "lock", nulls = Nulls.SKIP) - public _FinalStage lock(Optional lock) { - this.lock = lock; - return this; - } - - @Override + @java.lang.Override public LocksGetResponse build() { return new LocksGetResponse(lock, device, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/locks/types/LocksListRequestCustomMetadataHasValue.java b/src/main/java/com/seam/api/resources/locks/types/LocksListRequestCustomMetadataHasValue.java new file mode 100644 index 0000000..a5875c4 --- /dev/null +++ b/src/main/java/com/seam/api/resources/locks/types/LocksListRequestCustomMetadataHasValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.locks.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LocksListRequestCustomMetadataHasValue.Deserializer.class) +public final class LocksListRequestCustomMetadataHasValue { + private final Object value; + + private final int type; + + private LocksListRequestCustomMetadataHasValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LocksListRequestCustomMetadataHasValue + && equalTo((LocksListRequestCustomMetadataHasValue) other); + } + + private boolean equalTo(LocksListRequestCustomMetadataHasValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static LocksListRequestCustomMetadataHasValue of(String value) { + return new LocksListRequestCustomMetadataHasValue(value, 0); + } + + public static LocksListRequestCustomMetadataHasValue of(boolean value) { + return new LocksListRequestCustomMetadataHasValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LocksListRequestCustomMetadataHasValue.class); + } + + @java.lang.Override + public LocksListRequestCustomMetadataHasValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/resources/locks/types/LocksListRequestExcludeIfItem.java b/src/main/java/com/seam/api/resources/locks/types/LocksListRequestExcludeIfItem.java new file mode 100644 index 0000000..5a122af --- /dev/null +++ b/src/main/java/com/seam/api/resources/locks/types/LocksListRequestExcludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.locks.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocksListRequestExcludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + LocksListRequestExcludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/locks/types/LocksListRequestIncludeIfItem.java b/src/main/java/com/seam/api/resources/locks/types/LocksListRequestIncludeIfItem.java new file mode 100644 index 0000000..d82520f --- /dev/null +++ b/src/main/java/com/seam/api/resources/locks/types/LocksListRequestIncludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.locks.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LocksListRequestIncludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + LocksListRequestIncludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/LocksListResponse.java b/src/main/java/com/seam/api/resources/locks/types/LocksListResponse.java similarity index 77% rename from src/main/java/com/seam/api/types/LocksListResponse.java rename to src/main/java/com/seam/api/resources/locks/types/LocksListResponse.java index 29d35c5..0661190 100644 --- a/src/main/java/com/seam/api/types/LocksListResponse.java +++ b/src/main/java/com/seam/api/resources/locks/types/LocksListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.locks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,17 +12,17 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Device; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = LocksListResponse.Builder.class) public final class LocksListResponse { - private final Optional locks; + private final List locks; private final List devices; @@ -31,7 +31,7 @@ public final class LocksListResponse { private final Map additionalProperties; private LocksListResponse( - Optional locks, List devices, boolean ok, Map additionalProperties) { + List locks, List devices, boolean ok, Map additionalProperties) { this.locks = locks; this.devices = devices; this.ok = ok; @@ -39,7 +39,7 @@ private LocksListResponse( } @JsonProperty("locks") - public Optional getLocks() { + public List getLocks() { return locks; } @@ -53,7 +53,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksListResponse && equalTo((LocksListResponse) other); @@ -68,12 +68,12 @@ private boolean equalTo(LocksListResponse other) { return locks.equals(other.locks) && devices.equals(other.devices) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.locks, this.devices, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -91,9 +91,11 @@ public interface OkStage { public interface _FinalStage { LocksListResponse build(); - _FinalStage locks(Optional locks); + _FinalStage locks(List locks); - _FinalStage locks(Object locks); + _FinalStage addLocks(Device locks); + + _FinalStage addAllLocks(List locks); _FinalStage devices(List devices); @@ -108,14 +110,14 @@ public static final class Builder implements OkStage, _FinalStage { private List devices = new ArrayList<>(); - private Optional locks = Optional.empty(); + private List locks = new ArrayList<>(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(LocksListResponse other) { locks(other.getLocks()); devices(other.getDevices()); @@ -123,26 +125,26 @@ public Builder from(LocksListResponse other) { return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllDevices(List devices) { this.devices.addAll(devices); return this; } - @Override + @java.lang.Override public _FinalStage addDevices(Device devices) { this.devices.add(devices); return this; } - @Override + @java.lang.Override @JsonSetter(value = "devices", nulls = Nulls.SKIP) public _FinalStage devices(List devices) { this.devices.clear(); @@ -150,20 +152,27 @@ public _FinalStage devices(List devices) { return this; } - @Override - public _FinalStage locks(Object locks) { - this.locks = Optional.of(locks); + @java.lang.Override + public _FinalStage addAllLocks(List locks) { + this.locks.addAll(locks); + return this; + } + + @java.lang.Override + public _FinalStage addLocks(Device locks) { + this.locks.add(locks); return this; } - @Override + @java.lang.Override @JsonSetter(value = "locks", nulls = Nulls.SKIP) - public _FinalStage locks(Optional locks) { - this.locks = locks; + public _FinalStage locks(List locks) { + this.locks.clear(); + this.locks.addAll(locks); return this; } - @Override + @java.lang.Override public LocksListResponse build() { return new LocksListResponse(locks, devices, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/LocksLockDoorResponse.java b/src/main/java/com/seam/api/resources/locks/types/LocksLockDoorResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/LocksLockDoorResponse.java rename to src/main/java/com/seam/api/resources/locks/types/LocksLockDoorResponse.java index 82fdaae..9e5fbbb 100644 --- a/src/main/java/com/seam/api/types/LocksLockDoorResponse.java +++ b/src/main/java/com/seam/api/resources/locks/types/LocksLockDoorResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.locks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksLockDoorResponse && equalTo((LocksLockDoorResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(LocksLockDoorResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(LocksLockDoorResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public LocksLockDoorResponse build() { return new LocksLockDoorResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/LocksUnlockDoorResponse.java b/src/main/java/com/seam/api/resources/locks/types/LocksUnlockDoorResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/LocksUnlockDoorResponse.java rename to src/main/java/com/seam/api/resources/locks/types/LocksUnlockDoorResponse.java index a9902d8..9461f02 100644 --- a/src/main/java/com/seam/api/types/LocksUnlockDoorResponse.java +++ b/src/main/java/com/seam/api/resources/locks/types/LocksUnlockDoorResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.locks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof LocksUnlockDoorResponse && equalTo((LocksUnlockDoorResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(LocksUnlockDoorResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(LocksUnlockDoorResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public LocksUnlockDoorResponse build() { return new LocksUnlockDoorResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/networks/NetworksClient.java b/src/main/java/com/seam/api/resources/networks/NetworksClient.java new file mode 100644 index 0000000..56b6068 --- /dev/null +++ b/src/main/java/com/seam/api/resources/networks/NetworksClient.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.networks; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.networks.requests.NetworksGetRequest; +import com.seam.api.resources.networks.requests.NetworksListRequest; +import com.seam.api.resources.networks.types.NetworksGetResponse; +import com.seam.api.resources.networks.types.NetworksListResponse; +import com.seam.api.types.Network; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class NetworksClient { + protected final ClientOptions clientOptions; + + public NetworksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public Network get(NetworksGetRequest request) { + return get(request, null); + } + + public Network get(NetworksGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("networks/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + NetworksGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NetworksGetResponse.class); + return parsedResponse.getNetwork(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(NetworksListRequest.builder().build()); + } + + public List list(NetworksListRequest request) { + return list(request, null); + } + + public List list(NetworksListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("networks/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + NetworksListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NetworksListResponse.class); + return parsedResponse.getNetworks(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/networks/requests/NetworksGetRequest.java b/src/main/java/com/seam/api/resources/networks/requests/NetworksGetRequest.java new file mode 100644 index 0000000..9290c4b --- /dev/null +++ b/src/main/java/com/seam/api/resources/networks/requests/NetworksGetRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.networks.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = NetworksGetRequest.Builder.class) +public final class NetworksGetRequest { + private final String networkId; + + private final Map additionalProperties; + + private NetworksGetRequest(String networkId, Map additionalProperties) { + this.networkId = networkId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("network_id") + public String getNetworkId() { + return networkId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworksGetRequest && equalTo((NetworksGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NetworksGetRequest other) { + return networkId.equals(other.networkId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.networkId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NetworkIdStage builder() { + return new Builder(); + } + + public interface NetworkIdStage { + _FinalStage networkId(String networkId); + + Builder from(NetworksGetRequest other); + } + + public interface _FinalStage { + NetworksGetRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NetworkIdStage, _FinalStage { + private String networkId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(NetworksGetRequest other) { + networkId(other.getNetworkId()); + return this; + } + + @java.lang.Override + @JsonSetter("network_id") + public _FinalStage networkId(String networkId) { + this.networkId = networkId; + return this; + } + + @java.lang.Override + public NetworksGetRequest build() { + return new NetworksGetRequest(networkId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/networks/requests/NetworksListRequest.java b/src/main/java/com/seam/api/resources/networks/requests/NetworksListRequest.java new file mode 100644 index 0000000..e2dbfba --- /dev/null +++ b/src/main/java/com/seam/api/resources/networks/requests/NetworksListRequest.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.networks.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = NetworksListRequest.Builder.class) +public final class NetworksListRequest { + private final Map additionalProperties; + + private NetworksListRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworksListRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NetworksListRequest other) { + return this; + } + + public NetworksListRequest build() { + return new NetworksListRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/networks/types/NetworksGetResponse.java b/src/main/java/com/seam/api/resources/networks/types/NetworksGetResponse.java new file mode 100644 index 0000000..15510e0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/networks/types/NetworksGetResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.networks.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Network; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = NetworksGetResponse.Builder.class) +public final class NetworksGetResponse { + private final Network network; + + private final boolean ok; + + private final Map additionalProperties; + + private NetworksGetResponse(Network network, boolean ok, Map additionalProperties) { + this.network = network; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("network") + public Network getNetwork() { + return network; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworksGetResponse && equalTo((NetworksGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NetworksGetResponse other) { + return network.equals(other.network) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.network, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NetworkStage builder() { + return new Builder(); + } + + public interface NetworkStage { + OkStage network(Network network); + + Builder from(NetworksGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + NetworksGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NetworkStage, OkStage, _FinalStage { + private Network network; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(NetworksGetResponse other) { + network(other.getNetwork()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("network") + public OkStage network(Network network) { + this.network = network; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public NetworksGetResponse build() { + return new NetworksGetResponse(network, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/networks/types/NetworksListResponse.java b/src/main/java/com/seam/api/resources/networks/types/NetworksListResponse.java new file mode 100644 index 0000000..ca45d21 --- /dev/null +++ b/src/main/java/com/seam/api/resources/networks/types/NetworksListResponse.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.networks.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Network; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = NetworksListResponse.Builder.class) +public final class NetworksListResponse { + private final List networks; + + private final boolean ok; + + private final Map additionalProperties; + + private NetworksListResponse(List networks, boolean ok, Map additionalProperties) { + this.networks = networks; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("networks") + public List getNetworks() { + return networks; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NetworksListResponse && equalTo((NetworksListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NetworksListResponse other) { + return networks.equals(other.networks) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.networks, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(NetworksListResponse other); + } + + public interface _FinalStage { + NetworksListResponse build(); + + _FinalStage networks(List networks); + + _FinalStage addNetworks(Network networks); + + _FinalStage addAllNetworks(List networks); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List networks = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(NetworksListResponse other) { + networks(other.getNetworks()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllNetworks(List networks) { + this.networks.addAll(networks); + return this; + } + + @java.lang.Override + public _FinalStage addNetworks(Network networks) { + this.networks.add(networks); + return this; + } + + @java.lang.Override + @JsonSetter(value = "networks", nulls = Nulls.SKIP) + public _FinalStage networks(List networks) { + this.networks.clear(); + this.networks.addAll(networks); + return this; + } + + @java.lang.Override + public NetworksListResponse build() { + return new NetworksListResponse(networks, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/NoiseThresholdsClient.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/NoiseThresholdsClient.java index da365fb..e3ada28 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/NoiseThresholdsClient.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/NoiseThresholdsClient.java @@ -3,30 +3,35 @@ */ package com.seam.api.resources.noisesensors.noisethresholds; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.noisesensors.noisethresholds.requests.NoiseThresholdsCreateRequest; import com.seam.api.resources.noisesensors.noisethresholds.requests.NoiseThresholdsDeleteRequest; import com.seam.api.resources.noisesensors.noisethresholds.requests.NoiseThresholdsGetRequest; import com.seam.api.resources.noisesensors.noisethresholds.requests.NoiseThresholdsListRequest; import com.seam.api.resources.noisesensors.noisethresholds.requests.NoiseThresholdsUpdateRequest; -import com.seam.api.types.ActionAttempt; +import com.seam.api.resources.noisesensors.noisethresholds.types.NoiseThresholdsCreateResponse; +import com.seam.api.resources.noisesensors.noisethresholds.types.NoiseThresholdsDeleteResponse; +import com.seam.api.resources.noisesensors.noisethresholds.types.NoiseThresholdsGetResponse; +import com.seam.api.resources.noisesensors.noisethresholds.types.NoiseThresholdsListResponse; +import com.seam.api.resources.noisesensors.noisethresholds.types.NoiseThresholdsUpdateResponse; import com.seam.api.types.NoiseThreshold; -import com.seam.api.types.NoiseThresholdsCreateResponse; -import com.seam.api.types.NoiseThresholdsDeleteResponse; -import com.seam.api.types.NoiseThresholdsGetResponse; -import com.seam.api.types.NoiseThresholdsListResponse; -import com.seam.api.types.NoiseThresholdsUpdateResponse; import java.io.IOException; import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class NoiseThresholdsClient { protected final ClientOptions clientOptions; @@ -35,11 +40,11 @@ public NoiseThresholdsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public ActionAttempt create(NoiseThresholdsCreateRequest request) { + public NoiseThreshold create(NoiseThresholdsCreateRequest request) { return create(request, null); } - public ActionAttempt create(NoiseThresholdsCreateRequest request, RequestOptions requestOptions) { + public NoiseThreshold create(NoiseThresholdsCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("noise_sensors/noise_thresholds/create") @@ -47,9 +52,9 @@ public ActionAttempt create(NoiseThresholdsCreateRequest request, RequestOptions RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -57,27 +62,44 @@ public ActionAttempt create(NoiseThresholdsCreateRequest request, RequestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - NoiseThresholdsCreateResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), NoiseThresholdsCreateResponse.class); - return parsedResponse.getActionAttempt(); + NoiseThresholdsCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoiseThresholdsCreateResponse.class); + return parsedResponse.getNoiseThreshold(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ActionAttempt delete(NoiseThresholdsDeleteRequest request) { + public NoiseThresholdsDeleteResponse delete(NoiseThresholdsDeleteRequest request) { return delete(request, null); } - public ActionAttempt delete(NoiseThresholdsDeleteRequest request, RequestOptions requestOptions) { + public NoiseThresholdsDeleteResponse delete(NoiseThresholdsDeleteRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("noise_sensors/noise_thresholds/delete") @@ -85,9 +107,9 @@ public ActionAttempt delete(NoiseThresholdsDeleteRequest request, RequestOptions RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -95,19 +117,34 @@ public ActionAttempt delete(NoiseThresholdsDeleteRequest request, RequestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - NoiseThresholdsDeleteResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), NoiseThresholdsDeleteResponse.class); - return parsedResponse.getActionAttempt(); + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoiseThresholdsDeleteResponse.class); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -123,9 +160,9 @@ public NoiseThreshold get(NoiseThresholdsGetRequest request, RequestOptions requ RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -133,19 +170,36 @@ public NoiseThreshold get(NoiseThresholdsGetRequest request, RequestOptions requ .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { NoiseThresholdsGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), NoiseThresholdsGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoiseThresholdsGetResponse.class); return parsedResponse.getNoiseThreshold(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -161,9 +215,9 @@ public List list(NoiseThresholdsListRequest request, RequestOpti RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -171,27 +225,44 @@ public List list(NoiseThresholdsListRequest request, RequestOpti .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - NoiseThresholdsListResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), NoiseThresholdsListResponse.class); + NoiseThresholdsListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoiseThresholdsListResponse.class); return parsedResponse.getNoiseThresholds(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ActionAttempt update(NoiseThresholdsUpdateRequest request) { + public NoiseThresholdsUpdateResponse update(NoiseThresholdsUpdateRequest request) { return update(request, null); } - public ActionAttempt update(NoiseThresholdsUpdateRequest request, RequestOptions requestOptions) { + public NoiseThresholdsUpdateResponse update(NoiseThresholdsUpdateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("noise_sensors/noise_thresholds/update") @@ -199,9 +270,9 @@ public ActionAttempt update(NoiseThresholdsUpdateRequest request, RequestOptions RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -209,19 +280,34 @@ public ActionAttempt update(NoiseThresholdsUpdateRequest request, RequestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - NoiseThresholdsUpdateResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), NoiseThresholdsUpdateResponse.class); - return parsedResponse.getActionAttempt(); + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoiseThresholdsUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsCreateRequest.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsCreateRequest.java index a21a011..0a91717 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsCreateRequest.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsCreateRequest.java @@ -90,7 +90,7 @@ public Optional getNoiseThresholdNrs() { return noiseThresholdNrs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsCreateRequest && equalTo((NoiseThresholdsCreateRequest) other); @@ -111,7 +111,7 @@ private boolean equalTo(NoiseThresholdsCreateRequest other) { && noiseThresholdNrs.equals(other.noiseThresholdNrs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.deviceId, @@ -123,7 +123,7 @@ public int hashCode() { this.noiseThresholdNrs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -187,7 +187,7 @@ public static final class Builder implements DeviceIdStage, StartsDailyAtStage, private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsCreateRequest other) { deviceId(other.getDeviceId()); sync(other.getSync()); @@ -199,80 +199,80 @@ public Builder from(NoiseThresholdsCreateRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public StartsDailyAtStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("starts_daily_at") public EndsDailyAtStage startsDailyAt(String startsDailyAt) { this.startsDailyAt = startsDailyAt; return this; } - @Override + @java.lang.Override @JsonSetter("ends_daily_at") public _FinalStage endsDailyAt(String endsDailyAt) { this.endsDailyAt = endsDailyAt; return this; } - @Override + @java.lang.Override public _FinalStage noiseThresholdNrs(Double noiseThresholdNrs) { this.noiseThresholdNrs = Optional.of(noiseThresholdNrs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "noise_threshold_nrs", nulls = Nulls.SKIP) public _FinalStage noiseThresholdNrs(Optional noiseThresholdNrs) { this.noiseThresholdNrs = noiseThresholdNrs; return this; } - @Override + @java.lang.Override public _FinalStage noiseThresholdDecibels(Double noiseThresholdDecibels) { this.noiseThresholdDecibels = Optional.of(noiseThresholdDecibels); return this; } - @Override + @java.lang.Override @JsonSetter(value = "noise_threshold_decibels", nulls = Nulls.SKIP) public _FinalStage noiseThresholdDecibels(Optional noiseThresholdDecibels) { this.noiseThresholdDecibels = noiseThresholdDecibels; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public NoiseThresholdsCreateRequest build() { return new NoiseThresholdsCreateRequest( deviceId, diff --git a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsDeleteRequest.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsDeleteRequest.java index 6c2214e..145ca8e 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsDeleteRequest.java @@ -54,7 +54,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsDeleteRequest && equalTo((NoiseThresholdsDeleteRequest) other); @@ -71,12 +71,12 @@ private boolean equalTo(NoiseThresholdsDeleteRequest other) { && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.noiseThresholdId, this.deviceId, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -116,7 +116,7 @@ public static final class Builder implements NoiseThresholdIdStage, DeviceIdStag private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsDeleteRequest other) { noiseThresholdId(other.getNoiseThresholdId()); deviceId(other.getDeviceId()); @@ -124,34 +124,34 @@ public Builder from(NoiseThresholdsDeleteRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("noise_threshold_id") public DeviceIdStage noiseThresholdId(String noiseThresholdId) { this.noiseThresholdId = noiseThresholdId; return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public NoiseThresholdsDeleteRequest build() { return new NoiseThresholdsDeleteRequest(noiseThresholdId, deviceId, sync, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsGetRequest.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsGetRequest.java index 4317895..f256954 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsGetRequest.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsGetRequest.java @@ -32,7 +32,7 @@ public String getNoiseThresholdId() { return noiseThresholdId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsGetRequest && equalTo((NoiseThresholdsGetRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(NoiseThresholdsGetRequest other) { return noiseThresholdId.equals(other.noiseThresholdId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.noiseThresholdId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements NoiseThresholdIdStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsGetRequest other) { noiseThresholdId(other.getNoiseThresholdId()); return this; } - @Override + @java.lang.Override @JsonSetter("noise_threshold_id") public _FinalStage noiseThresholdId(String noiseThresholdId) { this.noiseThresholdId = noiseThresholdId; return this; } - @Override + @java.lang.Override public NoiseThresholdsGetRequest build() { return new NoiseThresholdsGetRequest(noiseThresholdId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsListRequest.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsListRequest.java index 18dce01..2f49221 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsListRequest.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsListRequest.java @@ -9,21 +9,27 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = NoiseThresholdsListRequest.Builder.class) public final class NoiseThresholdsListRequest { private final String deviceId; + private final Optional isProgrammed; + private final Map additionalProperties; - private NoiseThresholdsListRequest(String deviceId, Map additionalProperties) { + private NoiseThresholdsListRequest( + String deviceId, Optional isProgrammed, Map additionalProperties) { this.deviceId = deviceId; + this.isProgrammed = isProgrammed; this.additionalProperties = additionalProperties; } @@ -32,7 +38,12 @@ public String getDeviceId() { return deviceId; } - @Override + @JsonProperty("is_programmed") + public Optional getIsProgrammed() { + return isProgrammed; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsListRequest && equalTo((NoiseThresholdsListRequest) other); @@ -44,15 +55,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(NoiseThresholdsListRequest other) { - return deviceId.equals(other.deviceId); + return deviceId.equals(other.deviceId) && isProgrammed.equals(other.isProgrammed); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.deviceId); + return Objects.hash(this.deviceId, this.isProgrammed); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -69,33 +80,53 @@ public interface DeviceIdStage { public interface _FinalStage { NoiseThresholdsListRequest build(); + + _FinalStage isProgrammed(Optional isProgrammed); + + _FinalStage isProgrammed(Boolean isProgrammed); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceIdStage, _FinalStage { private String deviceId; + private Optional isProgrammed = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsListRequest other) { deviceId(other.getDeviceId()); + isProgrammed(other.getIsProgrammed()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override + public _FinalStage isProgrammed(Boolean isProgrammed) { + this.isProgrammed = Optional.of(isProgrammed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_programmed", nulls = Nulls.SKIP) + public _FinalStage isProgrammed(Optional isProgrammed) { + this.isProgrammed = isProgrammed; + return this; + } + + @java.lang.Override public NoiseThresholdsListRequest build() { - return new NoiseThresholdsListRequest(deviceId, additionalProperties); + return new NoiseThresholdsListRequest(deviceId, isProgrammed, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsUpdateRequest.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsUpdateRequest.java index 0452b17..ad906c8 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsUpdateRequest.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/requests/NoiseThresholdsUpdateRequest.java @@ -99,7 +99,7 @@ public Optional getNoiseThresholdNrs() { return noiseThresholdNrs; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsUpdateRequest && equalTo((NoiseThresholdsUpdateRequest) other); @@ -121,7 +121,7 @@ private boolean equalTo(NoiseThresholdsUpdateRequest other) { && noiseThresholdNrs.equals(other.noiseThresholdNrs); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.noiseThresholdId, @@ -134,7 +134,7 @@ public int hashCode() { this.noiseThresholdNrs); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -204,7 +204,7 @@ public static final class Builder implements NoiseThresholdIdStage, DeviceIdStag private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsUpdateRequest other) { noiseThresholdId(other.getNoiseThresholdId()); deviceId(other.getDeviceId()); @@ -217,99 +217,99 @@ public Builder from(NoiseThresholdsUpdateRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("noise_threshold_id") public DeviceIdStage noiseThresholdId(String noiseThresholdId) { this.noiseThresholdId = noiseThresholdId; return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public _FinalStage noiseThresholdNrs(Double noiseThresholdNrs) { this.noiseThresholdNrs = Optional.of(noiseThresholdNrs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "noise_threshold_nrs", nulls = Nulls.SKIP) public _FinalStage noiseThresholdNrs(Optional noiseThresholdNrs) { this.noiseThresholdNrs = noiseThresholdNrs; return this; } - @Override + @java.lang.Override public _FinalStage noiseThresholdDecibels(Double noiseThresholdDecibels) { this.noiseThresholdDecibels = Optional.of(noiseThresholdDecibels); return this; } - @Override + @java.lang.Override @JsonSetter(value = "noise_threshold_decibels", nulls = Nulls.SKIP) public _FinalStage noiseThresholdDecibels(Optional noiseThresholdDecibels) { this.noiseThresholdDecibels = noiseThresholdDecibels; return this; } - @Override + @java.lang.Override public _FinalStage endsDailyAt(String endsDailyAt) { this.endsDailyAt = Optional.of(endsDailyAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ends_daily_at", nulls = Nulls.SKIP) public _FinalStage endsDailyAt(Optional endsDailyAt) { this.endsDailyAt = endsDailyAt; return this; } - @Override + @java.lang.Override public _FinalStage startsDailyAt(String startsDailyAt) { this.startsDailyAt = Optional.of(startsDailyAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "starts_daily_at", nulls = Nulls.SKIP) public _FinalStage startsDailyAt(Optional startsDailyAt) { this.startsDailyAt = startsDailyAt; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public NoiseThresholdsUpdateRequest build() { return new NoiseThresholdsUpdateRequest( noiseThresholdId, diff --git a/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsCreateResponse.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsCreateResponse.java new file mode 100644 index 0000000..c67d754 --- /dev/null +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsCreateResponse.java @@ -0,0 +1,153 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.noisesensors.noisethresholds.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; +import com.seam.api.types.NoiseThreshold; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = NoiseThresholdsCreateResponse.Builder.class) +public final class NoiseThresholdsCreateResponse { + private final ActionAttempt actionAttempt; + + private final NoiseThreshold noiseThreshold; + + private final boolean ok; + + private final Map additionalProperties; + + private NoiseThresholdsCreateResponse( + ActionAttempt actionAttempt, + NoiseThreshold noiseThreshold, + boolean ok, + Map additionalProperties) { + this.actionAttempt = actionAttempt; + this.noiseThreshold = noiseThreshold; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("action_attempt") + public ActionAttempt getActionAttempt() { + return actionAttempt; + } + + @JsonProperty("noise_threshold") + public NoiseThreshold getNoiseThreshold() { + return noiseThreshold; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NoiseThresholdsCreateResponse && equalTo((NoiseThresholdsCreateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NoiseThresholdsCreateResponse other) { + return actionAttempt.equals(other.actionAttempt) + && noiseThreshold.equals(other.noiseThreshold) + && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttempt, this.noiseThreshold, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptStage builder() { + return new Builder(); + } + + public interface ActionAttemptStage { + NoiseThresholdStage actionAttempt(ActionAttempt actionAttempt); + + Builder from(NoiseThresholdsCreateResponse other); + } + + public interface NoiseThresholdStage { + OkStage noiseThreshold(NoiseThreshold noiseThreshold); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + NoiseThresholdsCreateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptStage, NoiseThresholdStage, OkStage, _FinalStage { + private ActionAttempt actionAttempt; + + private NoiseThreshold noiseThreshold; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(NoiseThresholdsCreateResponse other) { + actionAttempt(other.getActionAttempt()); + noiseThreshold(other.getNoiseThreshold()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("action_attempt") + public NoiseThresholdStage actionAttempt(ActionAttempt actionAttempt) { + this.actionAttempt = actionAttempt; + return this; + } + + @java.lang.Override + @JsonSetter("noise_threshold") + public OkStage noiseThreshold(NoiseThreshold noiseThreshold) { + this.noiseThreshold = noiseThreshold; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public NoiseThresholdsCreateResponse build() { + return new NoiseThresholdsCreateResponse(actionAttempt, noiseThreshold, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/NoiseThresholdsDeleteResponse.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/NoiseThresholdsDeleteResponse.java rename to src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsDeleteResponse.java index f5d969e..22f6896 100644 --- a/src/main/java/com/seam/api/types/NoiseThresholdsDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.noisesensors.noisethresholds.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsDeleteResponse && equalTo((NoiseThresholdsDeleteResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(NoiseThresholdsDeleteResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsDeleteResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public NoiseThresholdsDeleteResponse build() { return new NoiseThresholdsDeleteResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/NoiseThresholdsGetResponse.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/NoiseThresholdsGetResponse.java rename to src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsGetResponse.java index 89a3f15..0f4474f 100644 --- a/src/main/java/com/seam/api/types/NoiseThresholdsGetResponse.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.noisesensors.noisethresholds.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.NoiseThreshold; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsGetResponse && equalTo((NoiseThresholdsGetResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(NoiseThresholdsGetResponse other) { return noiseThreshold.equals(other.noiseThreshold) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.noiseThreshold, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements NoiseThresholdStage, OkStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsGetResponse other) { noiseThreshold(other.getNoiseThreshold()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("noise_threshold") public OkStage noiseThreshold(NoiseThreshold noiseThreshold) { this.noiseThreshold = noiseThreshold; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public NoiseThresholdsGetResponse build() { return new NoiseThresholdsGetResponse(noiseThreshold, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/NoiseThresholdsListResponse.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/NoiseThresholdsListResponse.java rename to src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsListResponse.java index 0a7afed..9d4cfdd 100644 --- a/src/main/java/com/seam/api/types/NoiseThresholdsListResponse.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.noisesensors.noisethresholds.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.NoiseThreshold; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +45,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsListResponse && equalTo((NoiseThresholdsListResponse) other); @@ -59,12 +60,12 @@ private boolean equalTo(NoiseThresholdsListResponse other) { return noiseThresholds.equals(other.noiseThresholds) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.noiseThresholds, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -100,33 +101,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsListResponse other) { noiseThresholds(other.getNoiseThresholds()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllNoiseThresholds(List noiseThresholds) { this.noiseThresholds.addAll(noiseThresholds); return this; } - @Override + @java.lang.Override public _FinalStage addNoiseThresholds(NoiseThreshold noiseThresholds) { this.noiseThresholds.add(noiseThresholds); return this; } - @Override + @java.lang.Override @JsonSetter(value = "noise_thresholds", nulls = Nulls.SKIP) public _FinalStage noiseThresholds(List noiseThresholds) { this.noiseThresholds.clear(); @@ -134,7 +135,7 @@ public _FinalStage noiseThresholds(List noiseThresholds) { return this; } - @Override + @java.lang.Override public NoiseThresholdsListResponse build() { return new NoiseThresholdsListResponse(noiseThresholds, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/NoiseThresholdsUpdateResponse.java b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsUpdateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/NoiseThresholdsUpdateResponse.java rename to src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsUpdateResponse.java index 23e0341..60b102b 100644 --- a/src/main/java/com/seam/api/types/NoiseThresholdsUpdateResponse.java +++ b/src/main/java/com/seam/api/resources/noisesensors/noisethresholds/types/NoiseThresholdsUpdateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.noisesensors.noisethresholds.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThresholdsUpdateResponse && equalTo((NoiseThresholdsUpdateResponse) other); @@ -56,12 +57,12 @@ private boolean equalTo(NoiseThresholdsUpdateResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -95,28 +96,28 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThresholdsUpdateResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public NoiseThresholdsUpdateResponse build() { return new NoiseThresholdsUpdateResponse(actionAttempt, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/noisesensors/simulate/SimulateClient.java b/src/main/java/com/seam/api/resources/noisesensors/simulate/SimulateClient.java index f9f22ef..828be0a 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/simulate/SimulateClient.java +++ b/src/main/java/com/seam/api/resources/noisesensors/simulate/SimulateClient.java @@ -3,19 +3,25 @@ */ package com.seam.api.resources.noisesensors.simulate; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.noisesensors.simulate.requests.SimulateTriggerNoiseThresholdRequest; -import com.seam.api.types.SimulateTriggerNoiseThresholdResponse; +import com.seam.api.resources.noisesensors.simulate.types.SimulateTriggerNoiseThresholdResponse; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class SimulateClient { protected final ClientOptions clientOptions; @@ -24,6 +30,10 @@ public SimulateClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + public SimulateTriggerNoiseThresholdResponse triggerNoiseThreshold(SimulateTriggerNoiseThresholdRequest request) { + return triggerNoiseThreshold(request, null); + } + public SimulateTriggerNoiseThresholdResponse triggerNoiseThreshold( SimulateTriggerNoiseThresholdRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -33,9 +43,9 @@ public SimulateTriggerNoiseThresholdResponse triggerNoiseThreshold( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -43,22 +53,35 @@ public SimulateTriggerNoiseThresholdResponse triggerNoiseThreshold( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), SimulateTriggerNoiseThresholdResponse.class); + responseBody.string(), SimulateTriggerNoiseThresholdResponse.class); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - - public SimulateTriggerNoiseThresholdResponse triggerNoiseThreshold(SimulateTriggerNoiseThresholdRequest request) { - return triggerNoiseThreshold(request, null); - } } diff --git a/src/main/java/com/seam/api/resources/noisesensors/simulate/requests/SimulateTriggerNoiseThresholdRequest.java b/src/main/java/com/seam/api/resources/noisesensors/simulate/requests/SimulateTriggerNoiseThresholdRequest.java index fd84633..856401c 100644 --- a/src/main/java/com/seam/api/resources/noisesensors/simulate/requests/SimulateTriggerNoiseThresholdRequest.java +++ b/src/main/java/com/seam/api/resources/noisesensors/simulate/requests/SimulateTriggerNoiseThresholdRequest.java @@ -32,7 +32,7 @@ public String getDeviceId() { return deviceId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SimulateTriggerNoiseThresholdRequest @@ -48,12 +48,12 @@ private boolean equalTo(SimulateTriggerNoiseThresholdRequest other) { return deviceId.equals(other.deviceId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SimulateTriggerNoiseThresholdRequest other) { deviceId(other.getDeviceId()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public SimulateTriggerNoiseThresholdRequest build() { return new SimulateTriggerNoiseThresholdRequest(deviceId, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/SimulateTriggerNoiseThresholdResponse.java b/src/main/java/com/seam/api/resources/noisesensors/simulate/types/SimulateTriggerNoiseThresholdResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/SimulateTriggerNoiseThresholdResponse.java rename to src/main/java/com/seam/api/resources/noisesensors/simulate/types/SimulateTriggerNoiseThresholdResponse.java index 5db79a7..cd47289 100644 --- a/src/main/java/com/seam/api/types/SimulateTriggerNoiseThresholdResponse.java +++ b/src/main/java/com/seam/api/resources/noisesensors/simulate/types/SimulateTriggerNoiseThresholdResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.noisesensors.simulate.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SimulateTriggerNoiseThresholdResponse @@ -48,12 +48,12 @@ private boolean equalTo(SimulateTriggerNoiseThresholdResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(SimulateTriggerNoiseThresholdResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public SimulateTriggerNoiseThresholdResponse build() { return new SimulateTriggerNoiseThresholdResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/phones/PhonesClient.java b/src/main/java/com/seam/api/resources/phones/PhonesClient.java new file mode 100644 index 0000000..7073081 --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/PhonesClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.core.Suppliers; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.phones.requests.PhonesDeactivateRequest; +import com.seam.api.resources.phones.requests.PhonesListRequest; +import com.seam.api.resources.phones.simulate.SimulateClient; +import com.seam.api.resources.phones.types.PhonesDeactivateResponse; +import com.seam.api.resources.phones.types.PhonesListResponse; +import com.seam.api.types.Phone; +import java.io.IOException; +import java.util.List; +import java.util.function.Supplier; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class PhonesClient { + protected final ClientOptions clientOptions; + + protected final Supplier simulateClient; + + public PhonesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.simulateClient = Suppliers.memoize(() -> new SimulateClient(clientOptions)); + } + + public PhonesDeactivateResponse deactivate(PhonesDeactivateRequest request) { + return deactivate(request, null); + } + + public PhonesDeactivateResponse deactivate(PhonesDeactivateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("phones/deactivate") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PhonesDeactivateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(PhonesListRequest.builder().build()); + } + + public List list(PhonesListRequest request) { + return list(request, null); + } + + public List list(PhonesListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("phones/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + PhonesListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PhonesListResponse.class); + return parsedResponse.getPhones(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public SimulateClient simulate() { + return this.simulateClient.get(); + } +} diff --git a/src/main/java/com/seam/api/resources/phones/requests/PhonesDeactivateRequest.java b/src/main/java/com/seam/api/resources/phones/requests/PhonesDeactivateRequest.java new file mode 100644 index 0000000..f6bb876 --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/requests/PhonesDeactivateRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhonesDeactivateRequest.Builder.class) +public final class PhonesDeactivateRequest { + private final String deviceId; + + private final Map additionalProperties; + + private PhonesDeactivateRequest(String deviceId, Map additionalProperties) { + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhonesDeactivateRequest && equalTo((PhonesDeactivateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhonesDeactivateRequest other) { + return deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + + Builder from(PhonesDeactivateRequest other); + } + + public interface _FinalStage { + PhonesDeactivateRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhonesDeactivateRequest other) { + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public PhonesDeactivateRequest build() { + return new PhonesDeactivateRequest(deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/requests/PhonesListRequest.java b/src/main/java/com/seam/api/resources/phones/requests/PhonesListRequest.java new file mode 100644 index 0000000..18afbab --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/requests/PhonesListRequest.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhonesListRequest.Builder.class) +public final class PhonesListRequest { + private final Optional ownerUserIdentityId; + + private final Map additionalProperties; + + private PhonesListRequest(Optional ownerUserIdentityId, Map additionalProperties) { + this.ownerUserIdentityId = ownerUserIdentityId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("owner_user_identity_id") + public Optional getOwnerUserIdentityId() { + return ownerUserIdentityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhonesListRequest && equalTo((PhonesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhonesListRequest other) { + return ownerUserIdentityId.equals(other.ownerUserIdentityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ownerUserIdentityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional ownerUserIdentityId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhonesListRequest other) { + ownerUserIdentityId(other.getOwnerUserIdentityId()); + return this; + } + + @JsonSetter(value = "owner_user_identity_id", nulls = Nulls.SKIP) + public Builder ownerUserIdentityId(Optional ownerUserIdentityId) { + this.ownerUserIdentityId = ownerUserIdentityId; + return this; + } + + public Builder ownerUserIdentityId(String ownerUserIdentityId) { + this.ownerUserIdentityId = Optional.of(ownerUserIdentityId); + return this; + } + + public PhonesListRequest build() { + return new PhonesListRequest(ownerUserIdentityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/simulate/SimulateClient.java b/src/main/java/com/seam/api/resources/phones/simulate/SimulateClient.java new file mode 100644 index 0000000..3789b26 --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/simulate/SimulateClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.simulate; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.phones.simulate.requests.SimulateCreateSandboxPhoneRequest; +import com.seam.api.resources.phones.simulate.types.SimulateCreateSandboxPhoneResponse; +import com.seam.api.types.Phone; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SimulateClient { + protected final ClientOptions clientOptions; + + public SimulateClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public Phone createSandboxPhone(SimulateCreateSandboxPhoneRequest request) { + return createSandboxPhone(request, null); + } + + public Phone createSandboxPhone(SimulateCreateSandboxPhoneRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("phones/simulate/create_sandbox_phone") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + SimulateCreateSandboxPhoneResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), SimulateCreateSandboxPhoneResponse.class); + return parsedResponse.getPhone(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/simulate/requests/SimulateCreateSandboxPhoneRequest.java b/src/main/java/com/seam/api/resources/phones/simulate/requests/SimulateCreateSandboxPhoneRequest.java new file mode 100644 index 0000000..89eb89b --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/simulate/requests/SimulateCreateSandboxPhoneRequest.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.simulate.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.phones.simulate.types.SimulateCreateSandboxPhoneRequestAssaAbloyMetadata; +import com.seam.api.resources.phones.simulate.types.SimulateCreateSandboxPhoneRequestPhoneMetadata; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateCreateSandboxPhoneRequest.Builder.class) +public final class SimulateCreateSandboxPhoneRequest { + private final Optional customSdkInstallationId; + + private final String userIdentityId; + + private final Optional phoneMetadata; + + private final Optional assaAbloyMetadata; + + private final Map additionalProperties; + + private SimulateCreateSandboxPhoneRequest( + Optional customSdkInstallationId, + String userIdentityId, + Optional phoneMetadata, + Optional assaAbloyMetadata, + Map additionalProperties) { + this.customSdkInstallationId = customSdkInstallationId; + this.userIdentityId = userIdentityId; + this.phoneMetadata = phoneMetadata; + this.assaAbloyMetadata = assaAbloyMetadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("custom_sdk_installation_id") + public Optional getCustomSdkInstallationId() { + return customSdkInstallationId; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("phone_metadata") + public Optional getPhoneMetadata() { + return phoneMetadata; + } + + @JsonProperty("assa_abloy_metadata") + public Optional getAssaAbloyMetadata() { + return assaAbloyMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateCreateSandboxPhoneRequest && equalTo((SimulateCreateSandboxPhoneRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateCreateSandboxPhoneRequest other) { + return customSdkInstallationId.equals(other.customSdkInstallationId) + && userIdentityId.equals(other.userIdentityId) + && phoneMetadata.equals(other.phoneMetadata) + && assaAbloyMetadata.equals(other.assaAbloyMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.customSdkInstallationId, this.userIdentityId, this.phoneMetadata, this.assaAbloyMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(SimulateCreateSandboxPhoneRequest other); + } + + public interface _FinalStage { + SimulateCreateSandboxPhoneRequest build(); + + _FinalStage customSdkInstallationId(Optional customSdkInstallationId); + + _FinalStage customSdkInstallationId(String customSdkInstallationId); + + _FinalStage phoneMetadata(Optional phoneMetadata); + + _FinalStage phoneMetadata(SimulateCreateSandboxPhoneRequestPhoneMetadata phoneMetadata); + + _FinalStage assaAbloyMetadata(Optional assaAbloyMetadata); + + _FinalStage assaAbloyMetadata(SimulateCreateSandboxPhoneRequestAssaAbloyMetadata assaAbloyMetadata); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + private Optional assaAbloyMetadata = Optional.empty(); + + private Optional phoneMetadata = Optional.empty(); + + private Optional customSdkInstallationId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SimulateCreateSandboxPhoneRequest other) { + customSdkInstallationId(other.getCustomSdkInstallationId()); + userIdentityId(other.getUserIdentityId()); + phoneMetadata(other.getPhoneMetadata()); + assaAbloyMetadata(other.getAssaAbloyMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public _FinalStage assaAbloyMetadata(SimulateCreateSandboxPhoneRequestAssaAbloyMetadata assaAbloyMetadata) { + this.assaAbloyMetadata = Optional.of(assaAbloyMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "assa_abloy_metadata", nulls = Nulls.SKIP) + public _FinalStage assaAbloyMetadata( + Optional assaAbloyMetadata) { + this.assaAbloyMetadata = assaAbloyMetadata; + return this; + } + + @java.lang.Override + public _FinalStage phoneMetadata(SimulateCreateSandboxPhoneRequestPhoneMetadata phoneMetadata) { + this.phoneMetadata = Optional.of(phoneMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone_metadata", nulls = Nulls.SKIP) + public _FinalStage phoneMetadata(Optional phoneMetadata) { + this.phoneMetadata = phoneMetadata; + return this; + } + + @java.lang.Override + public _FinalStage customSdkInstallationId(String customSdkInstallationId) { + this.customSdkInstallationId = Optional.of(customSdkInstallationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_sdk_installation_id", nulls = Nulls.SKIP) + public _FinalStage customSdkInstallationId(Optional customSdkInstallationId) { + this.customSdkInstallationId = customSdkInstallationId; + return this; + } + + @java.lang.Override + public SimulateCreateSandboxPhoneRequest build() { + return new SimulateCreateSandboxPhoneRequest( + customSdkInstallationId, userIdentityId, phoneMetadata, assaAbloyMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestAssaAbloyMetadata.java b/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestAssaAbloyMetadata.java new file mode 100644 index 0000000..f1027d8 --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestAssaAbloyMetadata.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.simulate.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateCreateSandboxPhoneRequestAssaAbloyMetadata.Builder.class) +public final class SimulateCreateSandboxPhoneRequestAssaAbloyMetadata { + private final Optional bleCapability; + + private final Optional hceCapability; + + private final Optional nfcCapability; + + private final Optional applicationVersion; + + private final Optional seosAppletVersion; + + private final Optional seosTsmEndpointId; + + private final Map additionalProperties; + + private SimulateCreateSandboxPhoneRequestAssaAbloyMetadata( + Optional bleCapability, + Optional hceCapability, + Optional nfcCapability, + Optional applicationVersion, + Optional seosAppletVersion, + Optional seosTsmEndpointId, + Map additionalProperties) { + this.bleCapability = bleCapability; + this.hceCapability = hceCapability; + this.nfcCapability = nfcCapability; + this.applicationVersion = applicationVersion; + this.seosAppletVersion = seosAppletVersion; + this.seosTsmEndpointId = seosTsmEndpointId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ble_capability") + public Optional getBleCapability() { + return bleCapability; + } + + @JsonProperty("hce_capability") + public Optional getHceCapability() { + return hceCapability; + } + + @JsonProperty("nfc_capability") + public Optional getNfcCapability() { + return nfcCapability; + } + + @JsonProperty("application_version") + public Optional getApplicationVersion() { + return applicationVersion; + } + + @JsonProperty("seos_applet_version") + public Optional getSeosAppletVersion() { + return seosAppletVersion; + } + + @JsonProperty("seos_tsm_endpoint_id") + public Optional getSeosTsmEndpointId() { + return seosTsmEndpointId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateCreateSandboxPhoneRequestAssaAbloyMetadata + && equalTo((SimulateCreateSandboxPhoneRequestAssaAbloyMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateCreateSandboxPhoneRequestAssaAbloyMetadata other) { + return bleCapability.equals(other.bleCapability) + && hceCapability.equals(other.hceCapability) + && nfcCapability.equals(other.nfcCapability) + && applicationVersion.equals(other.applicationVersion) + && seosAppletVersion.equals(other.seosAppletVersion) + && seosTsmEndpointId.equals(other.seosTsmEndpointId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.bleCapability, + this.hceCapability, + this.nfcCapability, + this.applicationVersion, + this.seosAppletVersion, + this.seosTsmEndpointId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional bleCapability = Optional.empty(); + + private Optional hceCapability = Optional.empty(); + + private Optional nfcCapability = Optional.empty(); + + private Optional applicationVersion = Optional.empty(); + + private Optional seosAppletVersion = Optional.empty(); + + private Optional seosTsmEndpointId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SimulateCreateSandboxPhoneRequestAssaAbloyMetadata other) { + bleCapability(other.getBleCapability()); + hceCapability(other.getHceCapability()); + nfcCapability(other.getNfcCapability()); + applicationVersion(other.getApplicationVersion()); + seosAppletVersion(other.getSeosAppletVersion()); + seosTsmEndpointId(other.getSeosTsmEndpointId()); + return this; + } + + @JsonSetter(value = "ble_capability", nulls = Nulls.SKIP) + public Builder bleCapability(Optional bleCapability) { + this.bleCapability = bleCapability; + return this; + } + + public Builder bleCapability(Boolean bleCapability) { + this.bleCapability = Optional.of(bleCapability); + return this; + } + + @JsonSetter(value = "hce_capability", nulls = Nulls.SKIP) + public Builder hceCapability(Optional hceCapability) { + this.hceCapability = hceCapability; + return this; + } + + public Builder hceCapability(Boolean hceCapability) { + this.hceCapability = Optional.of(hceCapability); + return this; + } + + @JsonSetter(value = "nfc_capability", nulls = Nulls.SKIP) + public Builder nfcCapability(Optional nfcCapability) { + this.nfcCapability = nfcCapability; + return this; + } + + public Builder nfcCapability(Boolean nfcCapability) { + this.nfcCapability = Optional.of(nfcCapability); + return this; + } + + @JsonSetter(value = "application_version", nulls = Nulls.SKIP) + public Builder applicationVersion(Optional applicationVersion) { + this.applicationVersion = applicationVersion; + return this; + } + + public Builder applicationVersion(String applicationVersion) { + this.applicationVersion = Optional.of(applicationVersion); + return this; + } + + @JsonSetter(value = "seos_applet_version", nulls = Nulls.SKIP) + public Builder seosAppletVersion(Optional seosAppletVersion) { + this.seosAppletVersion = seosAppletVersion; + return this; + } + + public Builder seosAppletVersion(String seosAppletVersion) { + this.seosAppletVersion = Optional.of(seosAppletVersion); + return this; + } + + @JsonSetter(value = "seos_tsm_endpoint_id", nulls = Nulls.SKIP) + public Builder seosTsmEndpointId(Optional seosTsmEndpointId) { + this.seosTsmEndpointId = seosTsmEndpointId; + return this; + } + + public Builder seosTsmEndpointId(Double seosTsmEndpointId) { + this.seosTsmEndpointId = Optional.of(seosTsmEndpointId); + return this; + } + + public SimulateCreateSandboxPhoneRequestAssaAbloyMetadata build() { + return new SimulateCreateSandboxPhoneRequestAssaAbloyMetadata( + bleCapability, + hceCapability, + nfcCapability, + applicationVersion, + seosAppletVersion, + seosTsmEndpointId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestPhoneMetadata.java b/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestPhoneMetadata.java new file mode 100644 index 0000000..11c3fc0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneRequestPhoneMetadata.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.simulate.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.PhoneOperatingSystem; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateCreateSandboxPhoneRequestPhoneMetadata.Builder.class) +public final class SimulateCreateSandboxPhoneRequestPhoneMetadata { + private final Optional operatingSystem; + + private final Optional osVersion; + + private final Optional deviceManufacturer; + + private final Optional deviceModel; + + private final Map additionalProperties; + + private SimulateCreateSandboxPhoneRequestPhoneMetadata( + Optional operatingSystem, + Optional osVersion, + Optional deviceManufacturer, + Optional deviceModel, + Map additionalProperties) { + this.operatingSystem = operatingSystem; + this.osVersion = osVersion; + this.deviceManufacturer = deviceManufacturer; + this.deviceModel = deviceModel; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("operating_system") + public Optional getOperatingSystem() { + return operatingSystem; + } + + @JsonProperty("os_version") + public Optional getOsVersion() { + return osVersion; + } + + @JsonProperty("device_manufacturer") + public Optional getDeviceManufacturer() { + return deviceManufacturer; + } + + @JsonProperty("device_model") + public Optional getDeviceModel() { + return deviceModel; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateCreateSandboxPhoneRequestPhoneMetadata + && equalTo((SimulateCreateSandboxPhoneRequestPhoneMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateCreateSandboxPhoneRequestPhoneMetadata other) { + return operatingSystem.equals(other.operatingSystem) + && osVersion.equals(other.osVersion) + && deviceManufacturer.equals(other.deviceManufacturer) + && deviceModel.equals(other.deviceModel); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.operatingSystem, this.osVersion, this.deviceManufacturer, this.deviceModel); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional operatingSystem = Optional.empty(); + + private Optional osVersion = Optional.empty(); + + private Optional deviceManufacturer = Optional.empty(); + + private Optional deviceModel = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SimulateCreateSandboxPhoneRequestPhoneMetadata other) { + operatingSystem(other.getOperatingSystem()); + osVersion(other.getOsVersion()); + deviceManufacturer(other.getDeviceManufacturer()); + deviceModel(other.getDeviceModel()); + return this; + } + + @JsonSetter(value = "operating_system", nulls = Nulls.SKIP) + public Builder operatingSystem(Optional operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + public Builder operatingSystem(PhoneOperatingSystem operatingSystem) { + this.operatingSystem = Optional.of(operatingSystem); + return this; + } + + @JsonSetter(value = "os_version", nulls = Nulls.SKIP) + public Builder osVersion(Optional osVersion) { + this.osVersion = osVersion; + return this; + } + + public Builder osVersion(String osVersion) { + this.osVersion = Optional.of(osVersion); + return this; + } + + @JsonSetter(value = "device_manufacturer", nulls = Nulls.SKIP) + public Builder deviceManufacturer(Optional deviceManufacturer) { + this.deviceManufacturer = deviceManufacturer; + return this; + } + + public Builder deviceManufacturer(String deviceManufacturer) { + this.deviceManufacturer = Optional.of(deviceManufacturer); + return this; + } + + @JsonSetter(value = "device_model", nulls = Nulls.SKIP) + public Builder deviceModel(Optional deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + public Builder deviceModel(String deviceModel) { + this.deviceModel = Optional.of(deviceModel); + return this; + } + + public SimulateCreateSandboxPhoneRequestPhoneMetadata build() { + return new SimulateCreateSandboxPhoneRequestPhoneMetadata( + operatingSystem, osVersion, deviceManufacturer, deviceModel, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneResponse.java b/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneResponse.java new file mode 100644 index 0000000..e66d019 --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/simulate/types/SimulateCreateSandboxPhoneResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.simulate.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Phone; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = SimulateCreateSandboxPhoneResponse.Builder.class) +public final class SimulateCreateSandboxPhoneResponse { + private final Phone phone; + + private final boolean ok; + + private final Map additionalProperties; + + private SimulateCreateSandboxPhoneResponse(Phone phone, boolean ok, Map additionalProperties) { + this.phone = phone; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("phone") + public Phone getPhone() { + return phone; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SimulateCreateSandboxPhoneResponse + && equalTo((SimulateCreateSandboxPhoneResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SimulateCreateSandboxPhoneResponse other) { + return phone.equals(other.phone) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.phone, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PhoneStage builder() { + return new Builder(); + } + + public interface PhoneStage { + OkStage phone(Phone phone); + + Builder from(SimulateCreateSandboxPhoneResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + SimulateCreateSandboxPhoneResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PhoneStage, OkStage, _FinalStage { + private Phone phone; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SimulateCreateSandboxPhoneResponse other) { + phone(other.getPhone()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("phone") + public OkStage phone(Phone phone) { + this.phone = phone; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public SimulateCreateSandboxPhoneResponse build() { + return new SimulateCreateSandboxPhoneResponse(phone, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/types/PhonesDeactivateResponse.java b/src/main/java/com/seam/api/resources/phones/types/PhonesDeactivateResponse.java new file mode 100644 index 0000000..c23c188 --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/types/PhonesDeactivateResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhonesDeactivateResponse.Builder.class) +public final class PhonesDeactivateResponse { + private final boolean ok; + + private final Map additionalProperties; + + private PhonesDeactivateResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhonesDeactivateResponse && equalTo((PhonesDeactivateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhonesDeactivateResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(PhonesDeactivateResponse other); + } + + public interface _FinalStage { + PhonesDeactivateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhonesDeactivateResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public PhonesDeactivateResponse build() { + return new PhonesDeactivateResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/phones/types/PhonesListResponse.java b/src/main/java/com/seam/api/resources/phones/types/PhonesListResponse.java new file mode 100644 index 0000000..242f42d --- /dev/null +++ b/src/main/java/com/seam/api/resources/phones/types/PhonesListResponse.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.phones.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Phone; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhonesListResponse.Builder.class) +public final class PhonesListResponse { + private final List phones; + + private final boolean ok; + + private final Map additionalProperties; + + private PhonesListResponse(List phones, boolean ok, Map additionalProperties) { + this.phones = phones; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("phones") + public List getPhones() { + return phones; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhonesListResponse && equalTo((PhonesListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhonesListResponse other) { + return phones.equals(other.phones) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.phones, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(PhonesListResponse other); + } + + public interface _FinalStage { + PhonesListResponse build(); + + _FinalStage phones(List phones); + + _FinalStage addPhones(Phone phones); + + _FinalStage addAllPhones(List phones); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List phones = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhonesListResponse other) { + phones(other.getPhones()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllPhones(List phones) { + this.phones.addAll(phones); + return this; + } + + @java.lang.Override + public _FinalStage addPhones(Phone phones) { + this.phones.add(phones); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phones", nulls = Nulls.SKIP) + public _FinalStage phones(List phones) { + this.phones.clear(); + this.phones.addAll(phones); + return this; + } + + @java.lang.Override + public PhonesListResponse build() { + return new PhonesListResponse(phones, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/ThermostatsClient.java b/src/main/java/com/seam/api/resources/thermostats/ThermostatsClient.java index b45a3bd..db3f53c 100644 --- a/src/main/java/com/seam/api/resources/thermostats/ThermostatsClient.java +++ b/src/main/java/com/seam/api/resources/thermostats/ThermostatsClient.java @@ -3,30 +3,45 @@ */ package com.seam.api.resources.thermostats; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; import com.seam.api.core.Suppliers; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.thermostats.climatesettingschedules.ClimateSettingSchedulesClient; +import com.seam.api.resources.thermostats.requests.ThermostatsCoolRequest; import com.seam.api.resources.thermostats.requests.ThermostatsGetRequest; +import com.seam.api.resources.thermostats.requests.ThermostatsHeatCoolRequest; import com.seam.api.resources.thermostats.requests.ThermostatsHeatRequest; import com.seam.api.resources.thermostats.requests.ThermostatsListRequest; +import com.seam.api.resources.thermostats.requests.ThermostatsOffRequest; +import com.seam.api.resources.thermostats.requests.ThermostatsSetFanModeRequest; import com.seam.api.resources.thermostats.requests.ThermostatsUpdateRequest; +import com.seam.api.resources.thermostats.types.ThermostatsCoolResponse; +import com.seam.api.resources.thermostats.types.ThermostatsGetResponse; +import com.seam.api.resources.thermostats.types.ThermostatsHeatCoolResponse; +import com.seam.api.resources.thermostats.types.ThermostatsHeatResponse; +import com.seam.api.resources.thermostats.types.ThermostatsListResponse; +import com.seam.api.resources.thermostats.types.ThermostatsOffResponse; +import com.seam.api.resources.thermostats.types.ThermostatsSetFanModeResponse; +import com.seam.api.resources.thermostats.types.ThermostatsUpdateResponse; +import com.seam.api.types.ActionAttempt; import com.seam.api.types.Device; -import com.seam.api.types.ThermostatsGetResponse; -import com.seam.api.types.ThermostatsHeatResponse; -import com.seam.api.types.ThermostatsListResponse; -import com.seam.api.types.ThermostatsUpdateResponse; import java.io.IOException; import java.util.List; import java.util.function.Supplier; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class ThermostatsClient { protected final ClientOptions clientOptions; @@ -38,6 +53,65 @@ public ThermostatsClient(ClientOptions clientOptions) { this.climateSettingSchedulesClient = Suppliers.memoize(() -> new ClimateSettingSchedulesClient(clientOptions)); } + public ActionAttempt cool(ThermostatsCoolRequest request) { + return cool(request, null); + } + + public ActionAttempt cool(ThermostatsCoolRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("thermostats/cool") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + ThermostatsCoolResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsCoolResponse.class); + return parsedResponse.getActionAttempt(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public Device get() { + return get(ThermostatsGetRequest.builder().build()); + } + public Device get(ThermostatsGetRequest request) { return get(request, null); } @@ -50,9 +124,9 @@ public Device get(ThermostatsGetRequest request, RequestOptions requestOptions) RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -60,31 +134,44 @@ public Device get(ThermostatsGetRequest request, RequestOptions requestOptions) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { ThermostatsGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ThermostatsGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsGetResponse.class); return parsedResponse.getThermostat(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public Device get() { - return get(ThermostatsGetRequest.builder().build()); - } - - public void heat(ThermostatsHeatRequest request) { - heat(request, null); + public ActionAttempt heat(ThermostatsHeatRequest request) { + return heat(request, null); } - public void heat(ThermostatsHeatRequest request, RequestOptions requestOptions) { + public ActionAttempt heat(ThermostatsHeatRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("thermostats/heat") @@ -92,9 +179,9 @@ public void heat(ThermostatsHeatRequest request, RequestOptions requestOptions) RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -102,21 +189,98 @@ public void heat(ThermostatsHeatRequest request, RequestOptions requestOptions) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + ThermostatsHeatResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsHeatResponse.class); + return parsedResponse.getActionAttempt(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public ActionAttempt heatCool(ThermostatsHeatCoolRequest request) { + return heatCool(request, null); + } + + public ActionAttempt heatCool(ThermostatsHeatCoolRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("thermostats/heat_cool") + .build(); + RequestBody body; try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ThermostatsHeatResponse.class); - return; + ThermostatsHeatCoolResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsHeatCoolResponse.class); + return parsedResponse.getActionAttempt(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } + public List list() { + return list(ThermostatsListRequest.builder().build()); + } + public List list(ThermostatsListRequest request) { return list(request, null); } @@ -129,9 +293,9 @@ public List list(ThermostatsListRequest request, RequestOptions requestO RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -139,41 +303,109 @@ public List list(ThermostatsListRequest request, RequestOptions requestO .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { ThermostatsListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ThermostatsListResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsListResponse.class); return parsedResponse.getThermostats(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public List list() { - return list(ThermostatsListRequest.builder().build()); + public ActionAttempt off(ThermostatsOffRequest request) { + return off(request, null); } - public void update(ThermostatsUpdateRequest request) { - update(request, null); + public ActionAttempt off(ThermostatsOffRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("thermostats/off") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + ThermostatsOffResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsOffResponse.class); + return parsedResponse.getActionAttempt(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } } - public void update(ThermostatsUpdateRequest request, RequestOptions requestOptions) { + public ActionAttempt setFanMode(ThermostatsSetFanModeRequest request) { + return setFanMode(request, null); + } + + public ActionAttempt setFanMode(ThermostatsSetFanModeRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("thermostats/update") + .addPathSegments("thermostats/set_fan_mode") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -181,18 +413,89 @@ public void update(ThermostatsUpdateRequest request, RequestOptions requestOptio .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + ThermostatsSetFanModeResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsSetFanModeResponse.class); + return parsedResponse.getActionAttempt(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public ThermostatsUpdateResponse update(ThermostatsUpdateRequest request) { + return update(request, null); + } + + public ThermostatsUpdateResponse update(ThermostatsUpdateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("thermostats/update") + .build(); + RequestBody body; try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), ThermostatsUpdateResponse.class); - return; + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ThermostatsUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/ClimateSettingSchedulesClient.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/ClimateSettingSchedulesClient.java index 9471a3e..1414dd3 100644 --- a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/ClimateSettingSchedulesClient.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/ClimateSettingSchedulesClient.java @@ -3,27 +3,35 @@ */ package com.seam.api.resources.thermostats.climatesettingschedules; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.thermostats.climatesettingschedules.requests.ClimateSettingSchedulesCreateRequest; import com.seam.api.resources.thermostats.climatesettingschedules.requests.ClimateSettingSchedulesDeleteRequest; import com.seam.api.resources.thermostats.climatesettingschedules.requests.ClimateSettingSchedulesGetRequest; import com.seam.api.resources.thermostats.climatesettingschedules.requests.ClimateSettingSchedulesListRequest; import com.seam.api.resources.thermostats.climatesettingschedules.requests.ClimateSettingSchedulesUpdateRequest; -import com.seam.api.types.ClimateSettingSchedulesCreateResponse; -import com.seam.api.types.ClimateSettingSchedulesDeleteResponse; -import com.seam.api.types.ClimateSettingSchedulesGetResponse; -import com.seam.api.types.ClimateSettingSchedulesListResponse; -import com.seam.api.types.ClimateSettingSchedulesUpdateResponse; +import com.seam.api.resources.thermostats.climatesettingschedules.types.ClimateSettingSchedulesCreateResponse; +import com.seam.api.resources.thermostats.climatesettingschedules.types.ClimateSettingSchedulesDeleteResponse; +import com.seam.api.resources.thermostats.climatesettingschedules.types.ClimateSettingSchedulesGetResponse; +import com.seam.api.resources.thermostats.climatesettingschedules.types.ClimateSettingSchedulesListResponse; +import com.seam.api.resources.thermostats.climatesettingschedules.types.ClimateSettingSchedulesUpdateResponse; +import com.seam.api.types.ClimateSettingSchedule; import java.io.IOException; +import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class ClimateSettingSchedulesClient { protected final ClientOptions clientOptions; @@ -32,8 +40,11 @@ public ClimateSettingSchedulesClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public ClimateSettingSchedulesCreateResponse create( - ClimateSettingSchedulesCreateRequest request, RequestOptions requestOptions) { + public ClimateSettingSchedule create(ClimateSettingSchedulesCreateRequest request) { + return create(request, null); + } + + public ClimateSettingSchedule create(ClimateSettingSchedulesCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("thermostats/climate_setting_schedules/create") @@ -41,9 +52,9 @@ public ClimateSettingSchedulesCreateResponse create( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -51,23 +62,41 @@ public ClimateSettingSchedulesCreateResponse create( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ClimateSettingSchedulesCreateResponse.class); + ClimateSettingSchedulesCreateResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ClimateSettingSchedulesCreateResponse.class); + return parsedResponse.getClimateSettingSchedule(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ClimateSettingSchedulesCreateResponse create(ClimateSettingSchedulesCreateRequest request) { - return create(request, null); + public ClimateSettingSchedulesDeleteResponse delete(ClimateSettingSchedulesDeleteRequest request) { + return delete(request, null); } public ClimateSettingSchedulesDeleteResponse delete( @@ -79,41 +108,57 @@ public ClimateSettingSchedulesDeleteResponse delete( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("DELETE", body) + .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ClimateSettingSchedulesDeleteResponse.class); + responseBody.string(), ClimateSettingSchedulesDeleteResponse.class); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ClimateSettingSchedulesDeleteResponse delete(ClimateSettingSchedulesDeleteRequest request) { - return delete(request, null); + public ClimateSettingSchedule get() { + return get(ClimateSettingSchedulesGetRequest.builder().build()); } - public ClimateSettingSchedulesGetResponse get() { - return get(ClimateSettingSchedulesGetRequest.builder().build()); + public ClimateSettingSchedule get(ClimateSettingSchedulesGetRequest request) { + return get(request, null); } - public ClimateSettingSchedulesGetResponse get( - ClimateSettingSchedulesGetRequest request, RequestOptions requestOptions) { + public ClimateSettingSchedule get(ClimateSettingSchedulesGetRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("thermostats/climate_setting_schedules/get") @@ -121,9 +166,9 @@ public ClimateSettingSchedulesGetResponse get( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -131,26 +176,44 @@ public ClimateSettingSchedulesGetResponse get( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ClimateSettingSchedulesGetResponse.class); + ClimateSettingSchedulesGetResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ClimateSettingSchedulesGetResponse.class); + return parsedResponse.getClimateSettingSchedule(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ClimateSettingSchedulesGetResponse get(ClimateSettingSchedulesGetRequest request) { - return get(request, null); + public List list(ClimateSettingSchedulesListRequest request) { + return list(request, null); } - public ClimateSettingSchedulesListResponse list( + public List list( ClimateSettingSchedulesListRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -159,9 +222,9 @@ public ClimateSettingSchedulesListResponse list( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -169,23 +232,41 @@ public ClimateSettingSchedulesListResponse list( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ClimateSettingSchedulesListResponse.class); + ClimateSettingSchedulesListResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ClimateSettingSchedulesListResponse.class); + return parsedResponse.getClimateSettingSchedules(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public ClimateSettingSchedulesListResponse list(ClimateSettingSchedulesListRequest request) { - return list(request, null); + public ClimateSettingSchedulesUpdateResponse update(ClimateSettingSchedulesUpdateRequest request) { + return update(request, null); } public ClimateSettingSchedulesUpdateResponse update( @@ -197,9 +278,9 @@ public ClimateSettingSchedulesUpdateResponse update( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -207,22 +288,35 @@ public ClimateSettingSchedulesUpdateResponse update( .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), ClimateSettingSchedulesUpdateResponse.class); + responseBody.string(), ClimateSettingSchedulesUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - - public ClimateSettingSchedulesUpdateResponse update(ClimateSettingSchedulesUpdateRequest request) { - return update(request, null); - } } diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesCreateRequest.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesCreateRequest.java index b72e914..8d0d265 100644 --- a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesCreateRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesCreateRequest.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.HvacModeSetting; +import com.seam.api.resources.thermostats.climatesettingschedules.types.ClimateSettingSchedulesCreateRequestHvacModeSetting; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -35,7 +35,7 @@ public final class ClimateSettingSchedulesCreateRequest { private final Optional automaticCoolingEnabled; - private final Optional hvacModeSetting; + private final Optional hvacModeSetting; private final Optional coolingSetPointCelsius; @@ -57,7 +57,7 @@ private ClimateSettingSchedulesCreateRequest( String scheduleEndsAt, Optional automaticHeatingEnabled, Optional automaticCoolingEnabled, - Optional hvacModeSetting, + Optional hvacModeSetting, Optional coolingSetPointCelsius, Optional heatingSetPointCelsius, Optional coolingSetPointFahrenheit, @@ -116,7 +116,7 @@ public Optional getAutomaticCoolingEnabled() { } @JsonProperty("hvac_mode_setting") - public Optional getHvacModeSetting() { + public Optional getHvacModeSetting() { return hvacModeSetting; } @@ -145,7 +145,7 @@ public Optional getManualOverrideAllowed() { return manualOverrideAllowed; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesCreateRequest @@ -173,7 +173,7 @@ private boolean equalTo(ClimateSettingSchedulesCreateRequest other) { && manualOverrideAllowed.equals(other.manualOverrideAllowed); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.scheduleType, @@ -191,7 +191,7 @@ public int hashCode() { this.manualOverrideAllowed); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -233,9 +233,9 @@ public interface _FinalStage { _FinalStage automaticCoolingEnabled(Boolean automaticCoolingEnabled); - _FinalStage hvacModeSetting(Optional hvacModeSetting); + _FinalStage hvacModeSetting(Optional hvacModeSetting); - _FinalStage hvacModeSetting(HvacModeSetting hvacModeSetting); + _FinalStage hvacModeSetting(ClimateSettingSchedulesCreateRequestHvacModeSetting hvacModeSetting); _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius); @@ -277,7 +277,7 @@ public static final class Builder private Optional coolingSetPointCelsius = Optional.empty(); - private Optional hvacModeSetting = Optional.empty(); + private Optional hvacModeSetting = Optional.empty(); private Optional automaticCoolingEnabled = Optional.empty(); @@ -292,7 +292,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesCreateRequest other) { scheduleType(other.getScheduleType()); deviceId(other.getDeviceId()); @@ -310,158 +310,159 @@ public Builder from(ClimateSettingSchedulesCreateRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public ScheduleStartsAtStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("schedule_starts_at") public ScheduleEndsAtStage scheduleStartsAt(String scheduleStartsAt) { this.scheduleStartsAt = scheduleStartsAt; return this; } - @Override + @java.lang.Override @JsonSetter("schedule_ends_at") public _FinalStage scheduleEndsAt(String scheduleEndsAt) { this.scheduleEndsAt = scheduleEndsAt; return this; } - @Override + @java.lang.Override public _FinalStage manualOverrideAllowed(Boolean manualOverrideAllowed) { this.manualOverrideAllowed = Optional.of(manualOverrideAllowed); return this; } - @Override + @java.lang.Override @JsonSetter(value = "manual_override_allowed", nulls = Nulls.SKIP) public _FinalStage manualOverrideAllowed(Optional manualOverrideAllowed) { this.manualOverrideAllowed = manualOverrideAllowed; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointFahrenheit(Double heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = Optional.of(heatingSetPointFahrenheit); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_fahrenheit", nulls = Nulls.SKIP) public _FinalStage heatingSetPointFahrenheit(Optional heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = heatingSetPointFahrenheit; return this; } - @Override + @java.lang.Override public _FinalStage coolingSetPointFahrenheit(Double coolingSetPointFahrenheit) { this.coolingSetPointFahrenheit = Optional.of(coolingSetPointFahrenheit); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cooling_set_point_fahrenheit", nulls = Nulls.SKIP) public _FinalStage coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit) { this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointCelsius(Double heatingSetPointCelsius) { this.heatingSetPointCelsius = Optional.of(heatingSetPointCelsius); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_celsius", nulls = Nulls.SKIP) public _FinalStage heatingSetPointCelsius(Optional heatingSetPointCelsius) { this.heatingSetPointCelsius = heatingSetPointCelsius; return this; } - @Override + @java.lang.Override public _FinalStage coolingSetPointCelsius(Double coolingSetPointCelsius) { this.coolingSetPointCelsius = Optional.of(coolingSetPointCelsius); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cooling_set_point_celsius", nulls = Nulls.SKIP) public _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius) { this.coolingSetPointCelsius = coolingSetPointCelsius; return this; } - @Override - public _FinalStage hvacModeSetting(HvacModeSetting hvacModeSetting) { + @java.lang.Override + public _FinalStage hvacModeSetting(ClimateSettingSchedulesCreateRequestHvacModeSetting hvacModeSetting) { this.hvacModeSetting = Optional.of(hvacModeSetting); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hvac_mode_setting", nulls = Nulls.SKIP) - public _FinalStage hvacModeSetting(Optional hvacModeSetting) { + public _FinalStage hvacModeSetting( + Optional hvacModeSetting) { this.hvacModeSetting = hvacModeSetting; return this; } - @Override + @java.lang.Override public _FinalStage automaticCoolingEnabled(Boolean automaticCoolingEnabled) { this.automaticCoolingEnabled = Optional.of(automaticCoolingEnabled); return this; } - @Override + @java.lang.Override @JsonSetter(value = "automatic_cooling_enabled", nulls = Nulls.SKIP) public _FinalStage automaticCoolingEnabled(Optional automaticCoolingEnabled) { this.automaticCoolingEnabled = automaticCoolingEnabled; return this; } - @Override + @java.lang.Override public _FinalStage automaticHeatingEnabled(Boolean automaticHeatingEnabled) { this.automaticHeatingEnabled = Optional.of(automaticHeatingEnabled); return this; } - @Override + @java.lang.Override @JsonSetter(value = "automatic_heating_enabled", nulls = Nulls.SKIP) public _FinalStage automaticHeatingEnabled(Optional automaticHeatingEnabled) { this.automaticHeatingEnabled = automaticHeatingEnabled; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage scheduleType(String scheduleType) { this.scheduleType = Optional.of(scheduleType); return this; } - @Override + @java.lang.Override @JsonSetter(value = "schedule_type", nulls = Nulls.SKIP) public _FinalStage scheduleType(Optional scheduleType) { this.scheduleType = scheduleType; return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesCreateRequest build() { return new ClimateSettingSchedulesCreateRequest( scheduleType, diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesDeleteRequest.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesDeleteRequest.java index 8aae481..ff191b2 100644 --- a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesDeleteRequest.java @@ -33,7 +33,7 @@ public String getClimateSettingScheduleId() { return climateSettingScheduleId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesDeleteRequest @@ -49,12 +49,12 @@ private boolean equalTo(ClimateSettingSchedulesDeleteRequest other) { return climateSettingScheduleId.equals(other.climateSettingScheduleId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.climateSettingScheduleId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -82,20 +82,20 @@ public static final class Builder implements ClimateSettingScheduleIdStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesDeleteRequest other) { climateSettingScheduleId(other.getClimateSettingScheduleId()); return this; } - @Override + @java.lang.Override @JsonSetter("climate_setting_schedule_id") public _FinalStage climateSettingScheduleId(String climateSettingScheduleId) { this.climateSettingScheduleId = climateSettingScheduleId; return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesDeleteRequest build() { return new ClimateSettingSchedulesDeleteRequest(climateSettingScheduleId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesGetRequest.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesGetRequest.java index 9fa4fed..2b7248a 100644 --- a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesGetRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesGetRequest.java @@ -45,7 +45,7 @@ public Optional getDeviceId() { return deviceId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesGetRequest && equalTo((ClimateSettingSchedulesGetRequest) other); @@ -60,12 +60,12 @@ private boolean equalTo(ClimateSettingSchedulesGetRequest other) { return climateSettingScheduleId.equals(other.climateSettingScheduleId) && deviceId.equals(other.deviceId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.climateSettingScheduleId, this.deviceId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesListRequest.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesListRequest.java index b0b6d17..f73cdc1 100644 --- a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesListRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesListRequest.java @@ -9,21 +9,27 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = ClimateSettingSchedulesListRequest.Builder.class) public final class ClimateSettingSchedulesListRequest { private final String deviceId; + private final Optional userIdentifierKey; + private final Map additionalProperties; - private ClimateSettingSchedulesListRequest(String deviceId, Map additionalProperties) { + private ClimateSettingSchedulesListRequest( + String deviceId, Optional userIdentifierKey, Map additionalProperties) { this.deviceId = deviceId; + this.userIdentifierKey = userIdentifierKey; this.additionalProperties = additionalProperties; } @@ -32,7 +38,12 @@ public String getDeviceId() { return deviceId; } - @Override + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesListRequest @@ -45,15 +56,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(ClimateSettingSchedulesListRequest other) { - return deviceId.equals(other.deviceId); + return deviceId.equals(other.deviceId) && userIdentifierKey.equals(other.userIdentifierKey); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.deviceId); + return Objects.hash(this.deviceId, this.userIdentifierKey); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -70,33 +81,53 @@ public interface DeviceIdStage { public interface _FinalStage { ClimateSettingSchedulesListRequest build(); + + _FinalStage userIdentifierKey(Optional userIdentifierKey); + + _FinalStage userIdentifierKey(String userIdentifierKey); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceIdStage, _FinalStage { private String deviceId; + private Optional userIdentifierKey = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesListRequest other) { deviceId(other.getDeviceId()); + userIdentifierKey(other.getUserIdentifierKey()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override + public _FinalStage userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public _FinalStage userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + @java.lang.Override public ClimateSettingSchedulesListRequest build() { - return new ClimateSettingSchedulesListRequest(deviceId, additionalProperties); + return new ClimateSettingSchedulesListRequest(deviceId, userIdentifierKey, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesUpdateRequest.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesUpdateRequest.java index 2b081aa..059e4ba 100644 --- a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesUpdateRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/requests/ClimateSettingSchedulesUpdateRequest.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.HvacModeSetting; +import com.seam.api.resources.thermostats.climatesettingschedules.types.ClimateSettingSchedulesUpdateRequestHvacModeSetting; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -35,7 +35,7 @@ public final class ClimateSettingSchedulesUpdateRequest { private final Optional automaticCoolingEnabled; - private final Optional hvacModeSetting; + private final Optional hvacModeSetting; private final Optional coolingSetPointCelsius; @@ -57,7 +57,7 @@ private ClimateSettingSchedulesUpdateRequest( Optional scheduleEndsAt, Optional automaticHeatingEnabled, Optional automaticCoolingEnabled, - Optional hvacModeSetting, + Optional hvacModeSetting, Optional coolingSetPointCelsius, Optional heatingSetPointCelsius, Optional coolingSetPointFahrenheit, @@ -116,7 +116,7 @@ public Optional getAutomaticCoolingEnabled() { } @JsonProperty("hvac_mode_setting") - public Optional getHvacModeSetting() { + public Optional getHvacModeSetting() { return hvacModeSetting; } @@ -145,7 +145,7 @@ public Optional getManualOverrideAllowed() { return manualOverrideAllowed; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesUpdateRequest @@ -173,7 +173,7 @@ private boolean equalTo(ClimateSettingSchedulesUpdateRequest other) { && manualOverrideAllowed.equals(other.manualOverrideAllowed); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.climateSettingScheduleId, @@ -191,7 +191,7 @@ public int hashCode() { this.manualOverrideAllowed); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -233,9 +233,9 @@ public interface _FinalStage { _FinalStage automaticCoolingEnabled(Boolean automaticCoolingEnabled); - _FinalStage hvacModeSetting(Optional hvacModeSetting); + _FinalStage hvacModeSetting(Optional hvacModeSetting); - _FinalStage hvacModeSetting(HvacModeSetting hvacModeSetting); + _FinalStage hvacModeSetting(ClimateSettingSchedulesUpdateRequestHvacModeSetting hvacModeSetting); _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius); @@ -272,7 +272,7 @@ public static final class Builder implements ClimateSettingScheduleIdStage, _Fin private Optional coolingSetPointCelsius = Optional.empty(); - private Optional hvacModeSetting = Optional.empty(); + private Optional hvacModeSetting = Optional.empty(); private Optional automaticCoolingEnabled = Optional.empty(); @@ -291,7 +291,7 @@ public static final class Builder implements ClimateSettingScheduleIdStage, _Fin private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesUpdateRequest other) { climateSettingScheduleId(other.getClimateSettingScheduleId()); scheduleType(other.getScheduleType()); @@ -309,170 +309,171 @@ public Builder from(ClimateSettingSchedulesUpdateRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("climate_setting_schedule_id") public _FinalStage climateSettingScheduleId(String climateSettingScheduleId) { this.climateSettingScheduleId = climateSettingScheduleId; return this; } - @Override + @java.lang.Override public _FinalStage manualOverrideAllowed(Boolean manualOverrideAllowed) { this.manualOverrideAllowed = Optional.of(manualOverrideAllowed); return this; } - @Override + @java.lang.Override @JsonSetter(value = "manual_override_allowed", nulls = Nulls.SKIP) public _FinalStage manualOverrideAllowed(Optional manualOverrideAllowed) { this.manualOverrideAllowed = manualOverrideAllowed; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointFahrenheit(Double heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = Optional.of(heatingSetPointFahrenheit); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_fahrenheit", nulls = Nulls.SKIP) public _FinalStage heatingSetPointFahrenheit(Optional heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = heatingSetPointFahrenheit; return this; } - @Override + @java.lang.Override public _FinalStage coolingSetPointFahrenheit(Double coolingSetPointFahrenheit) { this.coolingSetPointFahrenheit = Optional.of(coolingSetPointFahrenheit); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cooling_set_point_fahrenheit", nulls = Nulls.SKIP) public _FinalStage coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit) { this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointCelsius(Double heatingSetPointCelsius) { this.heatingSetPointCelsius = Optional.of(heatingSetPointCelsius); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_celsius", nulls = Nulls.SKIP) public _FinalStage heatingSetPointCelsius(Optional heatingSetPointCelsius) { this.heatingSetPointCelsius = heatingSetPointCelsius; return this; } - @Override + @java.lang.Override public _FinalStage coolingSetPointCelsius(Double coolingSetPointCelsius) { this.coolingSetPointCelsius = Optional.of(coolingSetPointCelsius); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cooling_set_point_celsius", nulls = Nulls.SKIP) public _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius) { this.coolingSetPointCelsius = coolingSetPointCelsius; return this; } - @Override - public _FinalStage hvacModeSetting(HvacModeSetting hvacModeSetting) { + @java.lang.Override + public _FinalStage hvacModeSetting(ClimateSettingSchedulesUpdateRequestHvacModeSetting hvacModeSetting) { this.hvacModeSetting = Optional.of(hvacModeSetting); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hvac_mode_setting", nulls = Nulls.SKIP) - public _FinalStage hvacModeSetting(Optional hvacModeSetting) { + public _FinalStage hvacModeSetting( + Optional hvacModeSetting) { this.hvacModeSetting = hvacModeSetting; return this; } - @Override + @java.lang.Override public _FinalStage automaticCoolingEnabled(Boolean automaticCoolingEnabled) { this.automaticCoolingEnabled = Optional.of(automaticCoolingEnabled); return this; } - @Override + @java.lang.Override @JsonSetter(value = "automatic_cooling_enabled", nulls = Nulls.SKIP) public _FinalStage automaticCoolingEnabled(Optional automaticCoolingEnabled) { this.automaticCoolingEnabled = automaticCoolingEnabled; return this; } - @Override + @java.lang.Override public _FinalStage automaticHeatingEnabled(Boolean automaticHeatingEnabled) { this.automaticHeatingEnabled = Optional.of(automaticHeatingEnabled); return this; } - @Override + @java.lang.Override @JsonSetter(value = "automatic_heating_enabled", nulls = Nulls.SKIP) public _FinalStage automaticHeatingEnabled(Optional automaticHeatingEnabled) { this.automaticHeatingEnabled = automaticHeatingEnabled; return this; } - @Override + @java.lang.Override public _FinalStage scheduleEndsAt(String scheduleEndsAt) { this.scheduleEndsAt = Optional.of(scheduleEndsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "schedule_ends_at", nulls = Nulls.SKIP) public _FinalStage scheduleEndsAt(Optional scheduleEndsAt) { this.scheduleEndsAt = scheduleEndsAt; return this; } - @Override + @java.lang.Override public _FinalStage scheduleStartsAt(String scheduleStartsAt) { this.scheduleStartsAt = Optional.of(scheduleStartsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "schedule_starts_at", nulls = Nulls.SKIP) public _FinalStage scheduleStartsAt(Optional scheduleStartsAt) { this.scheduleStartsAt = scheduleStartsAt; return this; } - @Override + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public _FinalStage scheduleType(String scheduleType) { this.scheduleType = Optional.of(scheduleType); return this; } - @Override + @java.lang.Override @JsonSetter(value = "schedule_type", nulls = Nulls.SKIP) public _FinalStage scheduleType(Optional scheduleType) { this.scheduleType = scheduleType; return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesUpdateRequest build() { return new ClimateSettingSchedulesUpdateRequest( climateSettingScheduleId, diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesCreateRequestHvacModeSetting.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesCreateRequestHvacModeSetting.java new file mode 100644 index 0000000..8296b9f --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesCreateRequestHvacModeSetting.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.climatesettingschedules.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ClimateSettingSchedulesCreateRequestHvacModeSetting { + OFF("off"), + + HEAT("heat"), + + COOL("cool"), + + HEAT_COOL("heat_cool"); + + private final String value; + + ClimateSettingSchedulesCreateRequestHvacModeSetting(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/ClimateSettingSchedulesCreateResponse.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesCreateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClimateSettingSchedulesCreateResponse.java rename to src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesCreateResponse.java index 305b6b5..c2b2fba 100644 --- a/src/main/java/com/seam/api/types/ClimateSettingSchedulesCreateResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesCreateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.climatesettingschedules.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClimateSettingSchedule; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesCreateResponse @@ -57,12 +58,12 @@ private boolean equalTo(ClimateSettingSchedulesCreateResponse other) { return climateSettingSchedule.equals(other.climateSettingSchedule) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.climateSettingSchedule, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +97,28 @@ public static final class Builder implements ClimateSettingScheduleStage, OkStag private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesCreateResponse other) { climateSettingSchedule(other.getClimateSettingSchedule()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("climate_setting_schedule") public OkStage climateSettingSchedule(ClimateSettingSchedule climateSettingSchedule) { this.climateSettingSchedule = climateSettingSchedule; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesCreateResponse build() { return new ClimateSettingSchedulesCreateResponse(climateSettingSchedule, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ClimateSettingSchedulesDeleteResponse.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClimateSettingSchedulesDeleteResponse.java rename to src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesDeleteResponse.java index 4bd601e..5e22d73 100644 --- a/src/main/java/com/seam/api/types/ClimateSettingSchedulesDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.climatesettingschedules.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesDeleteResponse @@ -48,12 +48,12 @@ private boolean equalTo(ClimateSettingSchedulesDeleteResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -81,20 +81,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesDeleteResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesDeleteResponse build() { return new ClimateSettingSchedulesDeleteResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ClimateSettingSchedulesGetResponse.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClimateSettingSchedulesGetResponse.java rename to src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesGetResponse.java index 1923e00..125dad4 100644 --- a/src/main/java/com/seam/api/types/ClimateSettingSchedulesGetResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.climatesettingschedules.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClimateSettingSchedule; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesGetResponse @@ -57,12 +58,12 @@ private boolean equalTo(ClimateSettingSchedulesGetResponse other) { return climateSettingSchedule.equals(other.climateSettingSchedule) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.climateSettingSchedule, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +97,28 @@ public static final class Builder implements ClimateSettingScheduleStage, OkStag private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesGetResponse other) { climateSettingSchedule(other.getClimateSettingSchedule()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("climate_setting_schedule") public OkStage climateSettingSchedule(ClimateSettingSchedule climateSettingSchedule) { this.climateSettingSchedule = climateSettingSchedule; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesGetResponse build() { return new ClimateSettingSchedulesGetResponse(climateSettingSchedule, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ClimateSettingSchedulesListResponse.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClimateSettingSchedulesListResponse.java rename to src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesListResponse.java index d9c0519..2ae62f3 100644 --- a/src/main/java/com/seam/api/types/ClimateSettingSchedulesListResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.climatesettingschedules.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClimateSettingSchedule; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -46,7 +47,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesListResponse @@ -62,12 +63,12 @@ private boolean equalTo(ClimateSettingSchedulesListResponse other) { return climateSettingSchedules.equals(other.climateSettingSchedules) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.climateSettingSchedules, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -103,33 +104,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesListResponse other) { climateSettingSchedules(other.getClimateSettingSchedules()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllClimateSettingSchedules(List climateSettingSchedules) { this.climateSettingSchedules.addAll(climateSettingSchedules); return this; } - @Override + @java.lang.Override public _FinalStage addClimateSettingSchedules(ClimateSettingSchedule climateSettingSchedules) { this.climateSettingSchedules.add(climateSettingSchedules); return this; } - @Override + @java.lang.Override @JsonSetter(value = "climate_setting_schedules", nulls = Nulls.SKIP) public _FinalStage climateSettingSchedules(List climateSettingSchedules) { this.climateSettingSchedules.clear(); @@ -137,7 +138,7 @@ public _FinalStage climateSettingSchedules(List climateS return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesListResponse build() { return new ClimateSettingSchedulesListResponse(climateSettingSchedules, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesUpdateRequestHvacModeSetting.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesUpdateRequestHvacModeSetting.java new file mode 100644 index 0000000..b014fb5 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesUpdateRequestHvacModeSetting.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.climatesettingschedules.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ClimateSettingSchedulesUpdateRequestHvacModeSetting { + OFF("off"), + + HEAT("heat"), + + COOL("cool"), + + HEAT_COOL("heat_cool"); + + private final String value; + + ClimateSettingSchedulesUpdateRequestHvacModeSetting(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/ClimateSettingSchedulesUpdateResponse.java b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesUpdateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ClimateSettingSchedulesUpdateResponse.java rename to src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesUpdateResponse.java index 522b906..f967f10 100644 --- a/src/main/java/com/seam/api/types/ClimateSettingSchedulesUpdateResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/climatesettingschedules/types/ClimateSettingSchedulesUpdateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.climatesettingschedules.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ClimateSettingSchedule; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -41,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedulesUpdateResponse @@ -57,12 +58,12 @@ private boolean equalTo(ClimateSettingSchedulesUpdateResponse other) { return climateSettingSchedule.equals(other.climateSettingSchedule) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.climateSettingSchedule, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -96,28 +97,28 @@ public static final class Builder implements ClimateSettingScheduleStage, OkStag private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedulesUpdateResponse other) { climateSettingSchedule(other.getClimateSettingSchedule()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("climate_setting_schedule") public OkStage climateSettingSchedule(ClimateSettingSchedule climateSettingSchedule) { this.climateSettingSchedule = climateSettingSchedule; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ClimateSettingSchedulesUpdateResponse build() { return new ClimateSettingSchedulesUpdateResponse(climateSettingSchedule, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsCoolRequest.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsCoolRequest.java new file mode 100644 index 0000000..b2cc406 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsCoolRequest.java @@ -0,0 +1,196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ThermostatsCoolRequest.Builder.class) +public final class ThermostatsCoolRequest { + private final String deviceId; + + private final Optional coolingSetPointCelsius; + + private final Optional coolingSetPointFahrenheit; + + private final Optional sync; + + private final Map additionalProperties; + + private ThermostatsCoolRequest( + String deviceId, + Optional coolingSetPointCelsius, + Optional coolingSetPointFahrenheit, + Optional sync, + Map additionalProperties) { + this.deviceId = deviceId; + this.coolingSetPointCelsius = coolingSetPointCelsius; + this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; + this.sync = sync; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("cooling_set_point_celsius") + public Optional getCoolingSetPointCelsius() { + return coolingSetPointCelsius; + } + + @JsonProperty("cooling_set_point_fahrenheit") + public Optional getCoolingSetPointFahrenheit() { + return coolingSetPointFahrenheit; + } + + @JsonProperty("sync") + public Optional getSync() { + return sync; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ThermostatsCoolRequest && equalTo((ThermostatsCoolRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ThermostatsCoolRequest other) { + return deviceId.equals(other.deviceId) + && coolingSetPointCelsius.equals(other.coolingSetPointCelsius) + && coolingSetPointFahrenheit.equals(other.coolingSetPointFahrenheit) + && sync.equals(other.sync); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.coolingSetPointCelsius, this.coolingSetPointFahrenheit, this.sync); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + + Builder from(ThermostatsCoolRequest other); + } + + public interface _FinalStage { + ThermostatsCoolRequest build(); + + _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius); + + _FinalStage coolingSetPointCelsius(Double coolingSetPointCelsius); + + _FinalStage coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit); + + _FinalStage coolingSetPointFahrenheit(Double coolingSetPointFahrenheit); + + _FinalStage sync(Optional sync); + + _FinalStage sync(Boolean sync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + private Optional sync = Optional.empty(); + + private Optional coolingSetPointFahrenheit = Optional.empty(); + + private Optional coolingSetPointCelsius = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ThermostatsCoolRequest other) { + deviceId(other.getDeviceId()); + coolingSetPointCelsius(other.getCoolingSetPointCelsius()); + coolingSetPointFahrenheit(other.getCoolingSetPointFahrenheit()); + sync(other.getSync()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public _FinalStage sync(Boolean sync) { + this.sync = Optional.of(sync); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sync", nulls = Nulls.SKIP) + public _FinalStage sync(Optional sync) { + this.sync = sync; + return this; + } + + @java.lang.Override + public _FinalStage coolingSetPointFahrenheit(Double coolingSetPointFahrenheit) { + this.coolingSetPointFahrenheit = Optional.of(coolingSetPointFahrenheit); + return this; + } + + @java.lang.Override + @JsonSetter(value = "cooling_set_point_fahrenheit", nulls = Nulls.SKIP) + public _FinalStage coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit) { + this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; + return this; + } + + @java.lang.Override + public _FinalStage coolingSetPointCelsius(Double coolingSetPointCelsius) { + this.coolingSetPointCelsius = Optional.of(coolingSetPointCelsius); + return this; + } + + @java.lang.Override + @JsonSetter(value = "cooling_set_point_celsius", nulls = Nulls.SKIP) + public _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius) { + this.coolingSetPointCelsius = coolingSetPointCelsius; + return this; + } + + @java.lang.Override + public ThermostatsCoolRequest build() { + return new ThermostatsCoolRequest( + deviceId, coolingSetPointCelsius, coolingSetPointFahrenheit, sync, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsGetRequest.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsGetRequest.java index 0ab1e7a..99eadef 100644 --- a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsGetRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsGetRequest.java @@ -43,7 +43,7 @@ public Optional getName() { return name; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsGetRequest && equalTo((ThermostatsGetRequest) other); @@ -58,12 +58,12 @@ private boolean equalTo(ThermostatsGetRequest other) { return deviceId.equals(other.deviceId) && name.equals(other.name); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.name); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/types/CurrentClimateSetting.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsHeatCoolRequest.java similarity index 50% rename from src/main/java/com/seam/api/types/CurrentClimateSetting.java rename to src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsHeatCoolRequest.java index a32a1a1..c061e7f 100644 --- a/src/main/java/com/seam/api/types/CurrentClimateSetting.java +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsHeatCoolRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.requests; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -18,60 +18,52 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = CurrentClimateSetting.Builder.class) -public final class CurrentClimateSetting { - private final Optional automaticHeatingEnabled; +@JsonDeserialize(builder = ThermostatsHeatCoolRequest.Builder.class) +public final class ThermostatsHeatCoolRequest { + private final String deviceId; - private final Optional automaticCoolingEnabled; + private final Optional heatingSetPointCelsius; - private final Optional hvacModeSetting; + private final Optional heatingSetPointFahrenheit; private final Optional coolingSetPointCelsius; - private final Optional heatingSetPointCelsius; - private final Optional coolingSetPointFahrenheit; - private final Optional heatingSetPointFahrenheit; - - private final Optional manualOverrideAllowed; + private final Optional sync; private final Map additionalProperties; - private CurrentClimateSetting( - Optional automaticHeatingEnabled, - Optional automaticCoolingEnabled, - Optional hvacModeSetting, - Optional coolingSetPointCelsius, + private ThermostatsHeatCoolRequest( + String deviceId, Optional heatingSetPointCelsius, - Optional coolingSetPointFahrenheit, Optional heatingSetPointFahrenheit, - Optional manualOverrideAllowed, + Optional coolingSetPointCelsius, + Optional coolingSetPointFahrenheit, + Optional sync, Map additionalProperties) { - this.automaticHeatingEnabled = automaticHeatingEnabled; - this.automaticCoolingEnabled = automaticCoolingEnabled; - this.hvacModeSetting = hvacModeSetting; - this.coolingSetPointCelsius = coolingSetPointCelsius; + this.deviceId = deviceId; this.heatingSetPointCelsius = heatingSetPointCelsius; - this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; this.heatingSetPointFahrenheit = heatingSetPointFahrenheit; - this.manualOverrideAllowed = manualOverrideAllowed; + this.coolingSetPointCelsius = coolingSetPointCelsius; + this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; + this.sync = sync; this.additionalProperties = additionalProperties; } - @JsonProperty("automatic_heating_enabled") - public Optional getAutomaticHeatingEnabled() { - return automaticHeatingEnabled; + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; } - @JsonProperty("automatic_cooling_enabled") - public Optional getAutomaticCoolingEnabled() { - return automaticCoolingEnabled; + @JsonProperty("heating_set_point_celsius") + public Optional getHeatingSetPointCelsius() { + return heatingSetPointCelsius; } - @JsonProperty("hvac_mode_setting") - public Optional getHvacModeSetting() { - return hvacModeSetting; + @JsonProperty("heating_set_point_fahrenheit") + public Optional getHeatingSetPointFahrenheit() { + return heatingSetPointFahrenheit; } @JsonProperty("cooling_set_point_celsius") @@ -79,30 +71,20 @@ public Optional getCoolingSetPointCelsius() { return coolingSetPointCelsius; } - @JsonProperty("heating_set_point_celsius") - public Optional getHeatingSetPointCelsius() { - return heatingSetPointCelsius; - } - @JsonProperty("cooling_set_point_fahrenheit") public Optional getCoolingSetPointFahrenheit() { return coolingSetPointFahrenheit; } - @JsonProperty("heating_set_point_fahrenheit") - public Optional getHeatingSetPointFahrenheit() { - return heatingSetPointFahrenheit; - } - - @JsonProperty("manual_override_allowed") - public Optional getManualOverrideAllowed() { - return manualOverrideAllowed; + @JsonProperty("sync") + public Optional getSync() { + return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof CurrentClimateSetting && equalTo((CurrentClimateSetting) other); + return other instanceof ThermostatsHeatCoolRequest && equalTo((ThermostatsHeatCoolRequest) other); } @JsonAnyGetter @@ -110,172 +92,176 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(CurrentClimateSetting other) { - return automaticHeatingEnabled.equals(other.automaticHeatingEnabled) - && automaticCoolingEnabled.equals(other.automaticCoolingEnabled) - && hvacModeSetting.equals(other.hvacModeSetting) - && coolingSetPointCelsius.equals(other.coolingSetPointCelsius) + private boolean equalTo(ThermostatsHeatCoolRequest other) { + return deviceId.equals(other.deviceId) && heatingSetPointCelsius.equals(other.heatingSetPointCelsius) - && coolingSetPointFahrenheit.equals(other.coolingSetPointFahrenheit) && heatingSetPointFahrenheit.equals(other.heatingSetPointFahrenheit) - && manualOverrideAllowed.equals(other.manualOverrideAllowed); + && coolingSetPointCelsius.equals(other.coolingSetPointCelsius) + && coolingSetPointFahrenheit.equals(other.coolingSetPointFahrenheit) + && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( - this.automaticHeatingEnabled, - this.automaticCoolingEnabled, - this.hvacModeSetting, - this.coolingSetPointCelsius, + this.deviceId, this.heatingSetPointCelsius, - this.coolingSetPointFahrenheit, this.heatingSetPointFahrenheit, - this.manualOverrideAllowed); + this.coolingSetPointCelsius, + this.coolingSetPointFahrenheit, + this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } - public static Builder builder() { + public static DeviceIdStage builder() { return new Builder(); } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional automaticHeatingEnabled = Optional.empty(); + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); - private Optional automaticCoolingEnabled = Optional.empty(); + Builder from(ThermostatsHeatCoolRequest other); + } - private Optional hvacModeSetting = Optional.empty(); + public interface _FinalStage { + ThermostatsHeatCoolRequest build(); - private Optional coolingSetPointCelsius = Optional.empty(); + _FinalStage heatingSetPointCelsius(Optional heatingSetPointCelsius); - private Optional heatingSetPointCelsius = Optional.empty(); + _FinalStage heatingSetPointCelsius(Double heatingSetPointCelsius); + + _FinalStage heatingSetPointFahrenheit(Optional heatingSetPointFahrenheit); + + _FinalStage heatingSetPointFahrenheit(Double heatingSetPointFahrenheit); + + _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius); + + _FinalStage coolingSetPointCelsius(Double coolingSetPointCelsius); + + _FinalStage coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit); + + _FinalStage coolingSetPointFahrenheit(Double coolingSetPointFahrenheit); + + _FinalStage sync(Optional sync); + + _FinalStage sync(Boolean sync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + private Optional sync = Optional.empty(); private Optional coolingSetPointFahrenheit = Optional.empty(); + private Optional coolingSetPointCelsius = Optional.empty(); + private Optional heatingSetPointFahrenheit = Optional.empty(); - private Optional manualOverrideAllowed = Optional.empty(); + private Optional heatingSetPointCelsius = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(CurrentClimateSetting other) { - automaticHeatingEnabled(other.getAutomaticHeatingEnabled()); - automaticCoolingEnabled(other.getAutomaticCoolingEnabled()); - hvacModeSetting(other.getHvacModeSetting()); - coolingSetPointCelsius(other.getCoolingSetPointCelsius()); + @java.lang.Override + public Builder from(ThermostatsHeatCoolRequest other) { + deviceId(other.getDeviceId()); heatingSetPointCelsius(other.getHeatingSetPointCelsius()); - coolingSetPointFahrenheit(other.getCoolingSetPointFahrenheit()); heatingSetPointFahrenheit(other.getHeatingSetPointFahrenheit()); - manualOverrideAllowed(other.getManualOverrideAllowed()); + coolingSetPointCelsius(other.getCoolingSetPointCelsius()); + coolingSetPointFahrenheit(other.getCoolingSetPointFahrenheit()); + sync(other.getSync()); return this; } - @JsonSetter(value = "automatic_heating_enabled", nulls = Nulls.SKIP) - public Builder automaticHeatingEnabled(Optional automaticHeatingEnabled) { - this.automaticHeatingEnabled = automaticHeatingEnabled; + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; return this; } - public Builder automaticHeatingEnabled(Boolean automaticHeatingEnabled) { - this.automaticHeatingEnabled = Optional.of(automaticHeatingEnabled); + @java.lang.Override + public _FinalStage sync(Boolean sync) { + this.sync = Optional.of(sync); return this; } - @JsonSetter(value = "automatic_cooling_enabled", nulls = Nulls.SKIP) - public Builder automaticCoolingEnabled(Optional automaticCoolingEnabled) { - this.automaticCoolingEnabled = automaticCoolingEnabled; + @java.lang.Override + @JsonSetter(value = "sync", nulls = Nulls.SKIP) + public _FinalStage sync(Optional sync) { + this.sync = sync; return this; } - public Builder automaticCoolingEnabled(Boolean automaticCoolingEnabled) { - this.automaticCoolingEnabled = Optional.of(automaticCoolingEnabled); + @java.lang.Override + public _FinalStage coolingSetPointFahrenheit(Double coolingSetPointFahrenheit) { + this.coolingSetPointFahrenheit = Optional.of(coolingSetPointFahrenheit); return this; } - @JsonSetter(value = "hvac_mode_setting", nulls = Nulls.SKIP) - public Builder hvacModeSetting(Optional hvacModeSetting) { - this.hvacModeSetting = hvacModeSetting; + @java.lang.Override + @JsonSetter(value = "cooling_set_point_fahrenheit", nulls = Nulls.SKIP) + public _FinalStage coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit) { + this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; return this; } - public Builder hvacModeSetting(String hvacModeSetting) { - this.hvacModeSetting = Optional.of(hvacModeSetting); + @java.lang.Override + public _FinalStage coolingSetPointCelsius(Double coolingSetPointCelsius) { + this.coolingSetPointCelsius = Optional.of(coolingSetPointCelsius); return this; } + @java.lang.Override @JsonSetter(value = "cooling_set_point_celsius", nulls = Nulls.SKIP) - public Builder coolingSetPointCelsius(Optional coolingSetPointCelsius) { + public _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius) { this.coolingSetPointCelsius = coolingSetPointCelsius; return this; } - public Builder coolingSetPointCelsius(Double coolingSetPointCelsius) { - this.coolingSetPointCelsius = Optional.of(coolingSetPointCelsius); - return this; - } - - @JsonSetter(value = "heating_set_point_celsius", nulls = Nulls.SKIP) - public Builder heatingSetPointCelsius(Optional heatingSetPointCelsius) { - this.heatingSetPointCelsius = heatingSetPointCelsius; - return this; - } - - public Builder heatingSetPointCelsius(Double heatingSetPointCelsius) { - this.heatingSetPointCelsius = Optional.of(heatingSetPointCelsius); - return this; - } - - @JsonSetter(value = "cooling_set_point_fahrenheit", nulls = Nulls.SKIP) - public Builder coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit) { - this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; - return this; - } - - public Builder coolingSetPointFahrenheit(Double coolingSetPointFahrenheit) { - this.coolingSetPointFahrenheit = Optional.of(coolingSetPointFahrenheit); + @java.lang.Override + public _FinalStage heatingSetPointFahrenheit(Double heatingSetPointFahrenheit) { + this.heatingSetPointFahrenheit = Optional.of(heatingSetPointFahrenheit); return this; } + @java.lang.Override @JsonSetter(value = "heating_set_point_fahrenheit", nulls = Nulls.SKIP) - public Builder heatingSetPointFahrenheit(Optional heatingSetPointFahrenheit) { + public _FinalStage heatingSetPointFahrenheit(Optional heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = heatingSetPointFahrenheit; return this; } - public Builder heatingSetPointFahrenheit(Double heatingSetPointFahrenheit) { - this.heatingSetPointFahrenheit = Optional.of(heatingSetPointFahrenheit); - return this; - } - - @JsonSetter(value = "manual_override_allowed", nulls = Nulls.SKIP) - public Builder manualOverrideAllowed(Optional manualOverrideAllowed) { - this.manualOverrideAllowed = manualOverrideAllowed; + @java.lang.Override + public _FinalStage heatingSetPointCelsius(Double heatingSetPointCelsius) { + this.heatingSetPointCelsius = Optional.of(heatingSetPointCelsius); return this; } - public Builder manualOverrideAllowed(Boolean manualOverrideAllowed) { - this.manualOverrideAllowed = Optional.of(manualOverrideAllowed); + @java.lang.Override + @JsonSetter(value = "heating_set_point_celsius", nulls = Nulls.SKIP) + public _FinalStage heatingSetPointCelsius(Optional heatingSetPointCelsius) { + this.heatingSetPointCelsius = heatingSetPointCelsius; return this; } - public CurrentClimateSetting build() { - return new CurrentClimateSetting( - automaticHeatingEnabled, - automaticCoolingEnabled, - hvacModeSetting, - coolingSetPointCelsius, + @java.lang.Override + public ThermostatsHeatCoolRequest build() { + return new ThermostatsHeatCoolRequest( + deviceId, heatingSetPointCelsius, - coolingSetPointFahrenheit, heatingSetPointFahrenheit, - manualOverrideAllowed, + coolingSetPointCelsius, + coolingSetPointFahrenheit, + sync, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsHeatRequest.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsHeatRequest.java index 93fc581..22e142d 100644 --- a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsHeatRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsHeatRequest.java @@ -63,7 +63,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsHeatRequest && equalTo((ThermostatsHeatRequest) other); @@ -81,12 +81,12 @@ private boolean equalTo(ThermostatsHeatRequest other) { && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.heatingSetPointCelsius, this.heatingSetPointFahrenheit, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,7 +132,7 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ThermostatsHeatRequest other) { deviceId(other.getDeviceId()); heatingSetPointCelsius(other.getHeatingSetPointCelsius()); @@ -141,53 +141,53 @@ public Builder from(ThermostatsHeatRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointFahrenheit(Double heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = Optional.of(heatingSetPointFahrenheit); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_fahrenheit", nulls = Nulls.SKIP) public _FinalStage heatingSetPointFahrenheit(Optional heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = heatingSetPointFahrenheit; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointCelsius(Double heatingSetPointCelsius) { this.heatingSetPointCelsius = Optional.of(heatingSetPointCelsius); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_celsius", nulls = Nulls.SKIP) public _FinalStage heatingSetPointCelsius(Optional heatingSetPointCelsius) { this.heatingSetPointCelsius = heatingSetPointCelsius; return this; } - @Override + @java.lang.Override public ThermostatsHeatRequest build() { return new ThermostatsHeatRequest( deviceId, heatingSetPointCelsius, heatingSetPointFahrenheit, sync, additionalProperties); diff --git a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsListRequest.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsListRequest.java index 6049475..d9e1689 100644 --- a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsListRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsListRequest.java @@ -12,6 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.thermostats.types.ThermostatsListRequestCustomMetadataHasValue; +import com.seam.api.resources.thermostats.types.ThermostatsListRequestExcludeIfItem; +import com.seam.api.resources.thermostats.types.ThermostatsListRequestIncludeIfItem; import com.seam.api.types.DeviceType; import com.seam.api.types.Manufacturer; import java.time.OffsetDateTime; @@ -42,6 +45,14 @@ public final class ThermostatsListRequest { private final Optional createdBefore; + private final Optional userIdentifierKey; + + private final Optional> customMetadataHas; + + private final Optional> includeIf; + + private final Optional> excludeIf; + private final Map additionalProperties; private ThermostatsListRequest( @@ -54,6 +65,10 @@ private ThermostatsListRequest( Optional> deviceIds, Optional limit, Optional createdBefore, + Optional userIdentifierKey, + Optional> customMetadataHas, + Optional> includeIf, + Optional> excludeIf, Map additionalProperties) { this.connectedAccountId = connectedAccountId; this.connectedAccountIds = connectedAccountIds; @@ -64,9 +79,16 @@ private ThermostatsListRequest( this.deviceIds = deviceIds; this.limit = limit; this.createdBefore = createdBefore; + this.userIdentifierKey = userIdentifierKey; + this.customMetadataHas = customMetadataHas; + this.includeIf = includeIf; + this.excludeIf = excludeIf; this.additionalProperties = additionalProperties; } + /** + * @return List all devices owned by this connected account + */ @JsonProperty("connected_account_id") public Optional getConnectedAccountId() { return connectedAccountId; @@ -112,7 +134,27 @@ public Optional getCreatedBefore() { return createdBefore; } - @Override + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + + @JsonProperty("custom_metadata_has") + public Optional> getCustomMetadataHas() { + return customMetadataHas; + } + + @JsonProperty("include_if") + public Optional> getIncludeIf() { + return includeIf; + } + + @JsonProperty("exclude_if") + public Optional> getExcludeIf() { + return excludeIf; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsListRequest && equalTo((ThermostatsListRequest) other); @@ -132,10 +174,14 @@ private boolean equalTo(ThermostatsListRequest other) { && manufacturer.equals(other.manufacturer) && deviceIds.equals(other.deviceIds) && limit.equals(other.limit) - && createdBefore.equals(other.createdBefore); + && createdBefore.equals(other.createdBefore) + && userIdentifierKey.equals(other.userIdentifierKey) + && customMetadataHas.equals(other.customMetadataHas) + && includeIf.equals(other.includeIf) + && excludeIf.equals(other.excludeIf); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectedAccountId, @@ -146,10 +192,14 @@ public int hashCode() { this.manufacturer, this.deviceIds, this.limit, - this.createdBefore); + this.createdBefore, + this.userIdentifierKey, + this.customMetadataHas, + this.includeIf, + this.excludeIf); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -178,6 +228,15 @@ public static final class Builder { private Optional createdBefore = Optional.empty(); + private Optional userIdentifierKey = Optional.empty(); + + private Optional> customMetadataHas = + Optional.empty(); + + private Optional> includeIf = Optional.empty(); + + private Optional> excludeIf = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -193,6 +252,10 @@ public Builder from(ThermostatsListRequest other) { deviceIds(other.getDeviceIds()); limit(other.getLimit()); createdBefore(other.getCreatedBefore()); + userIdentifierKey(other.getUserIdentifierKey()); + customMetadataHas(other.getCustomMetadataHas()); + includeIf(other.getIncludeIf()); + excludeIf(other.getExcludeIf()); return this; } @@ -295,6 +358,51 @@ public Builder createdBefore(OffsetDateTime createdBefore) { return this; } + @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) + public Builder userIdentifierKey(Optional userIdentifierKey) { + this.userIdentifierKey = userIdentifierKey; + return this; + } + + public Builder userIdentifierKey(String userIdentifierKey) { + this.userIdentifierKey = Optional.of(userIdentifierKey); + return this; + } + + @JsonSetter(value = "custom_metadata_has", nulls = Nulls.SKIP) + public Builder customMetadataHas( + Optional> customMetadataHas) { + this.customMetadataHas = customMetadataHas; + return this; + } + + public Builder customMetadataHas(Map customMetadataHas) { + this.customMetadataHas = Optional.of(customMetadataHas); + return this; + } + + @JsonSetter(value = "include_if", nulls = Nulls.SKIP) + public Builder includeIf(Optional> includeIf) { + this.includeIf = includeIf; + return this; + } + + public Builder includeIf(List includeIf) { + this.includeIf = Optional.of(includeIf); + return this; + } + + @JsonSetter(value = "exclude_if", nulls = Nulls.SKIP) + public Builder excludeIf(Optional> excludeIf) { + this.excludeIf = excludeIf; + return this; + } + + public Builder excludeIf(List excludeIf) { + this.excludeIf = Optional.of(excludeIf); + return this; + } + public ThermostatsListRequest build() { return new ThermostatsListRequest( connectedAccountId, @@ -306,6 +414,10 @@ public ThermostatsListRequest build() { deviceIds, limit, createdBefore, + userIdentifierKey, + customMetadataHas, + includeIf, + excludeIf, additionalProperties); } } diff --git a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsOffRequest.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsOffRequest.java new file mode 100644 index 0000000..f7d0071 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsOffRequest.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ThermostatsOffRequest.Builder.class) +public final class ThermostatsOffRequest { + private final String deviceId; + + private final Optional sync; + + private final Map additionalProperties; + + private ThermostatsOffRequest(String deviceId, Optional sync, Map additionalProperties) { + this.deviceId = deviceId; + this.sync = sync; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("sync") + public Optional getSync() { + return sync; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ThermostatsOffRequest && equalTo((ThermostatsOffRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ThermostatsOffRequest other) { + return deviceId.equals(other.deviceId) && sync.equals(other.sync); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.sync); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + + Builder from(ThermostatsOffRequest other); + } + + public interface _FinalStage { + ThermostatsOffRequest build(); + + _FinalStage sync(Optional sync); + + _FinalStage sync(Boolean sync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, _FinalStage { + private String deviceId; + + private Optional sync = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ThermostatsOffRequest other) { + deviceId(other.getDeviceId()); + sync(other.getSync()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public _FinalStage sync(Boolean sync) { + this.sync = Optional.of(sync); + return this; + } + + @java.lang.Override + @JsonSetter(value = "sync", nulls = Nulls.SKIP) + public _FinalStage sync(Optional sync) { + this.sync = sync; + return this; + } + + @java.lang.Override + public ThermostatsOffRequest build() { + return new ThermostatsOffRequest(deviceId, sync, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsSetFanModeRequest.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsSetFanModeRequest.java index 95c4474..124f2fe 100644 --- a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsSetFanModeRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsSetFanModeRequest.java @@ -12,7 +12,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.FanModeSetting; +import com.seam.api.resources.thermostats.types.ThermostatsSetFanModeRequestFanModeSetting; +import com.seam.api.types.FanMode; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -23,9 +24,9 @@ public final class ThermostatsSetFanModeRequest { private final String deviceId; - private final Optional fanMode; + private final Optional fanMode; - private final Optional fanModeSetting; + private final Optional fanModeSetting; private final Optional sync; @@ -33,8 +34,8 @@ public final class ThermostatsSetFanModeRequest { private ThermostatsSetFanModeRequest( String deviceId, - Optional fanMode, - Optional fanModeSetting, + Optional fanMode, + Optional fanModeSetting, Optional sync, Map additionalProperties) { this.deviceId = deviceId; @@ -50,12 +51,12 @@ public String getDeviceId() { } @JsonProperty("fan_mode") - public Optional getFanMode() { + public Optional getFanMode() { return fanMode; } @JsonProperty("fan_mode_setting") - public Optional getFanModeSetting() { + public Optional getFanModeSetting() { return fanModeSetting; } @@ -64,7 +65,7 @@ public Optional getSync() { return sync; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsSetFanModeRequest && equalTo((ThermostatsSetFanModeRequest) other); @@ -82,12 +83,12 @@ private boolean equalTo(ThermostatsSetFanModeRequest other) { && sync.equals(other.sync); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.fanMode, this.fanModeSetting, this.sync); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -105,13 +106,13 @@ public interface DeviceIdStage { public interface _FinalStage { ThermostatsSetFanModeRequest build(); - _FinalStage fanMode(Optional fanMode); + _FinalStage fanMode(Optional fanMode); - _FinalStage fanMode(FanModeSetting fanMode); + _FinalStage fanMode(FanMode fanMode); - _FinalStage fanModeSetting(Optional fanModeSetting); + _FinalStage fanModeSetting(Optional fanModeSetting); - _FinalStage fanModeSetting(FanModeSetting fanModeSetting); + _FinalStage fanModeSetting(ThermostatsSetFanModeRequestFanModeSetting fanModeSetting); _FinalStage sync(Optional sync); @@ -124,16 +125,16 @@ public static final class Builder implements DeviceIdStage, _FinalStage { private Optional sync = Optional.empty(); - private Optional fanModeSetting = Optional.empty(); + private Optional fanModeSetting = Optional.empty(); - private Optional fanMode = Optional.empty(); + private Optional fanMode = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(ThermostatsSetFanModeRequest other) { deviceId(other.getDeviceId()); fanMode(other.getFanMode()); @@ -142,53 +143,53 @@ public Builder from(ThermostatsSetFanModeRequest other) { return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public _FinalStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public _FinalStage sync(Boolean sync) { this.sync = Optional.of(sync); return this; } - @Override + @java.lang.Override @JsonSetter(value = "sync", nulls = Nulls.SKIP) public _FinalStage sync(Optional sync) { this.sync = sync; return this; } - @Override - public _FinalStage fanModeSetting(FanModeSetting fanModeSetting) { + @java.lang.Override + public _FinalStage fanModeSetting(ThermostatsSetFanModeRequestFanModeSetting fanModeSetting) { this.fanModeSetting = Optional.of(fanModeSetting); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fan_mode_setting", nulls = Nulls.SKIP) - public _FinalStage fanModeSetting(Optional fanModeSetting) { + public _FinalStage fanModeSetting(Optional fanModeSetting) { this.fanModeSetting = fanModeSetting; return this; } - @Override - public _FinalStage fanMode(FanModeSetting fanMode) { + @java.lang.Override + public _FinalStage fanMode(FanMode fanMode) { this.fanMode = Optional.of(fanMode); return this; } - @Override + @java.lang.Override @JsonSetter(value = "fan_mode", nulls = Nulls.SKIP) - public _FinalStage fanMode(Optional fanMode) { + public _FinalStage fanMode(Optional fanMode) { this.fanMode = fanMode; return this; } - @Override + @java.lang.Override public ThermostatsSetFanModeRequest build() { return new ThermostatsSetFanModeRequest(deviceId, fanMode, fanModeSetting, sync, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsUpdateRequest.java b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsUpdateRequest.java index ccffbf6..6569e11 100644 --- a/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsUpdateRequest.java +++ b/src/main/java/com/seam/api/resources/thermostats/requests/ThermostatsUpdateRequest.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; -import com.seam.api.types.ThermostatsUpdateRequestDefaultClimateSetting; +import com.seam.api.resources.thermostats.types.ThermostatsUpdateRequestDefaultClimateSetting; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -44,7 +44,7 @@ public ThermostatsUpdateRequestDefaultClimateSetting getDefaultClimateSetting() return defaultClimateSetting; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsUpdateRequest && equalTo((ThermostatsUpdateRequest) other); @@ -59,12 +59,12 @@ private boolean equalTo(ThermostatsUpdateRequest other) { return deviceId.equals(other.deviceId) && defaultClimateSetting.equals(other.defaultClimateSetting); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceId, this.defaultClimateSetting); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,28 +98,28 @@ public static final class Builder implements DeviceIdStage, DefaultClimateSettin private Builder() {} - @Override + @java.lang.Override public Builder from(ThermostatsUpdateRequest other) { deviceId(other.getDeviceId()); defaultClimateSetting(other.getDefaultClimateSetting()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public DefaultClimateSettingStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("default_climate_setting") public _FinalStage defaultClimateSetting(ThermostatsUpdateRequestDefaultClimateSetting defaultClimateSetting) { this.defaultClimateSetting = defaultClimateSetting; return this; } - @Override + @java.lang.Override public ThermostatsUpdateRequest build() { return new ThermostatsUpdateRequest(deviceId, defaultClimateSetting, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsCoolResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsCoolResponse.java new file mode 100644 index 0000000..a964ef8 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsCoolResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ThermostatsCoolResponse.Builder.class) +public final class ThermostatsCoolResponse { + private final ActionAttempt actionAttempt; + + private final boolean ok; + + private final Map additionalProperties; + + private ThermostatsCoolResponse(ActionAttempt actionAttempt, boolean ok, Map additionalProperties) { + this.actionAttempt = actionAttempt; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("action_attempt") + public ActionAttempt getActionAttempt() { + return actionAttempt; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ThermostatsCoolResponse && equalTo((ThermostatsCoolResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ThermostatsCoolResponse other) { + return actionAttempt.equals(other.actionAttempt) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttempt, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptStage builder() { + return new Builder(); + } + + public interface ActionAttemptStage { + OkStage actionAttempt(ActionAttempt actionAttempt); + + Builder from(ThermostatsCoolResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + ThermostatsCoolResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptStage, OkStage, _FinalStage { + private ActionAttempt actionAttempt; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ThermostatsCoolResponse other) { + actionAttempt(other.getActionAttempt()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("action_attempt") + public OkStage actionAttempt(ActionAttempt actionAttempt) { + this.actionAttempt = actionAttempt; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ThermostatsCoolResponse build() { + return new ThermostatsCoolResponse(actionAttempt, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ThermostatsGetResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ThermostatsGetResponse.java rename to src/main/java/com/seam/api/resources/thermostats/types/ThermostatsGetResponse.java index f0198e6..8aae57a 100644 --- a/src/main/java/com/seam/api/types/ThermostatsGetResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Device; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsGetResponse && equalTo((ThermostatsGetResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(ThermostatsGetResponse other) { return thermostat.equals(other.thermostat) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.thermostat, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements ThermostatStage, OkStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(ThermostatsGetResponse other) { thermostat(other.getThermostat()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("thermostat") public OkStage thermostat(Device thermostat) { this.thermostat = thermostat; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ThermostatsGetResponse build() { return new ThermostatsGetResponse(thermostat, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatCoolResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatCoolResponse.java new file mode 100644 index 0000000..3eef710 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatCoolResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ThermostatsHeatCoolResponse.Builder.class) +public final class ThermostatsHeatCoolResponse { + private final ActionAttempt actionAttempt; + + private final boolean ok; + + private final Map additionalProperties; + + private ThermostatsHeatCoolResponse( + ActionAttempt actionAttempt, boolean ok, Map additionalProperties) { + this.actionAttempt = actionAttempt; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("action_attempt") + public ActionAttempt getActionAttempt() { + return actionAttempt; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ThermostatsHeatCoolResponse && equalTo((ThermostatsHeatCoolResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ThermostatsHeatCoolResponse other) { + return actionAttempt.equals(other.actionAttempt) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttempt, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptStage builder() { + return new Builder(); + } + + public interface ActionAttemptStage { + OkStage actionAttempt(ActionAttempt actionAttempt); + + Builder from(ThermostatsHeatCoolResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + ThermostatsHeatCoolResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptStage, OkStage, _FinalStage { + private ActionAttempt actionAttempt; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ThermostatsHeatCoolResponse other) { + actionAttempt(other.getActionAttempt()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("action_attempt") + public OkStage actionAttempt(ActionAttempt actionAttempt) { + this.actionAttempt = actionAttempt; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ThermostatsHeatCoolResponse build() { + return new ThermostatsHeatCoolResponse(actionAttempt, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatResponse.java new file mode 100644 index 0000000..c9d8372 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsHeatResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ThermostatsHeatResponse.Builder.class) +public final class ThermostatsHeatResponse { + private final ActionAttempt actionAttempt; + + private final boolean ok; + + private final Map additionalProperties; + + private ThermostatsHeatResponse(ActionAttempt actionAttempt, boolean ok, Map additionalProperties) { + this.actionAttempt = actionAttempt; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("action_attempt") + public ActionAttempt getActionAttempt() { + return actionAttempt; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ThermostatsHeatResponse && equalTo((ThermostatsHeatResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ThermostatsHeatResponse other) { + return actionAttempt.equals(other.actionAttempt) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttempt, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptStage builder() { + return new Builder(); + } + + public interface ActionAttemptStage { + OkStage actionAttempt(ActionAttempt actionAttempt); + + Builder from(ThermostatsHeatResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + ThermostatsHeatResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptStage, OkStage, _FinalStage { + private ActionAttempt actionAttempt; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ThermostatsHeatResponse other) { + actionAttempt(other.getActionAttempt()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("action_attempt") + public OkStage actionAttempt(ActionAttempt actionAttempt) { + this.actionAttempt = actionAttempt; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ThermostatsHeatResponse build() { + return new ThermostatsHeatResponse(actionAttempt, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestCustomMetadataHasValue.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestCustomMetadataHasValue.java new file mode 100644 index 0000000..c0963df --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestCustomMetadataHasValue.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ThermostatsListRequestCustomMetadataHasValue.Deserializer.class) +public final class ThermostatsListRequestCustomMetadataHasValue { + private final Object value; + + private final int type; + + private ThermostatsListRequestCustomMetadataHasValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ThermostatsListRequestCustomMetadataHasValue + && equalTo((ThermostatsListRequestCustomMetadataHasValue) other); + } + + private boolean equalTo(ThermostatsListRequestCustomMetadataHasValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ThermostatsListRequestCustomMetadataHasValue of(String value) { + return new ThermostatsListRequestCustomMetadataHasValue(value, 0); + } + + public static ThermostatsListRequestCustomMetadataHasValue of(boolean value) { + return new ThermostatsListRequestCustomMetadataHasValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ThermostatsListRequestCustomMetadataHasValue.class); + } + + @java.lang.Override + public ThermostatsListRequestCustomMetadataHasValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestExcludeIfItem.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestExcludeIfItem.java new file mode 100644 index 0000000..1924ae9 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestExcludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ThermostatsListRequestExcludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + ThermostatsListRequestExcludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestIncludeIfItem.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestIncludeIfItem.java new file mode 100644 index 0000000..61b5500 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListRequestIncludeIfItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ThermostatsListRequestIncludeIfItem { + CAN_REMOTELY_UNLOCK("can_remotely_unlock"), + + CAN_REMOTELY_LOCK("can_remotely_lock"), + + CAN_PROGRAM_OFFLINE_ACCESS_CODES("can_program_offline_access_codes"), + + CAN_PROGRAM_ONLINE_ACCESS_CODES("can_program_online_access_codes"), + + CAN_SIMULATE_REMOVAL("can_simulate_removal"), + + CAN_SIMULATE_CONNECTION("can_simulate_connection"), + + CAN_SIMULATE_DISCONNECTION("can_simulate_disconnection"); + + private final String value; + + ThermostatsListRequestIncludeIfItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/ThermostatsListResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ThermostatsListResponse.java rename to src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListResponse.java index 6a3b6a4..f55da44 100644 --- a/src/main/java/com/seam/api/types/ThermostatsListResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Device; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -43,7 +44,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsListResponse && equalTo((ThermostatsListResponse) other); @@ -58,12 +59,12 @@ private boolean equalTo(ThermostatsListResponse other) { return thermostats.equals(other.thermostats) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.thermostats, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,33 +100,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ThermostatsListResponse other) { thermostats(other.getThermostats()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllThermostats(List thermostats) { this.thermostats.addAll(thermostats); return this; } - @Override + @java.lang.Override public _FinalStage addThermostats(Device thermostats) { this.thermostats.add(thermostats); return this; } - @Override + @java.lang.Override @JsonSetter(value = "thermostats", nulls = Nulls.SKIP) public _FinalStage thermostats(List thermostats) { this.thermostats.clear(); @@ -133,7 +134,7 @@ public _FinalStage thermostats(List thermostats) { return this; } - @Override + @java.lang.Override public ThermostatsListResponse build() { return new ThermostatsListResponse(thermostats, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsOffResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsOffResponse.java new file mode 100644 index 0000000..661a695 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsOffResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ThermostatsOffResponse.Builder.class) +public final class ThermostatsOffResponse { + private final ActionAttempt actionAttempt; + + private final boolean ok; + + private final Map additionalProperties; + + private ThermostatsOffResponse(ActionAttempt actionAttempt, boolean ok, Map additionalProperties) { + this.actionAttempt = actionAttempt; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("action_attempt") + public ActionAttempt getActionAttempt() { + return actionAttempt; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ThermostatsOffResponse && equalTo((ThermostatsOffResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ThermostatsOffResponse other) { + return actionAttempt.equals(other.actionAttempt) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttempt, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptStage builder() { + return new Builder(); + } + + public interface ActionAttemptStage { + OkStage actionAttempt(ActionAttempt actionAttempt); + + Builder from(ThermostatsOffResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + ThermostatsOffResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptStage, OkStage, _FinalStage { + private ActionAttempt actionAttempt; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ThermostatsOffResponse other) { + actionAttempt(other.getActionAttempt()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("action_attempt") + public OkStage actionAttempt(ActionAttempt actionAttempt) { + this.actionAttempt = actionAttempt; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public ThermostatsOffResponse build() { + return new ThermostatsOffResponse(actionAttempt, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsSetFanModeRequestFanModeSetting.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsSetFanModeRequestFanModeSetting.java new file mode 100644 index 0000000..ea03c01 --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsSetFanModeRequestFanModeSetting.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ThermostatsSetFanModeRequestFanModeSetting { + AUTO("auto"), + + ON("on"); + + private final String value; + + ThermostatsSetFanModeRequestFanModeSetting(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/NoiseThresholdsCreateResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsSetFanModeResponse.java similarity index 75% rename from src/main/java/com/seam/api/types/NoiseThresholdsCreateResponse.java rename to src/main/java/com/seam/api/resources/thermostats/types/ThermostatsSetFanModeResponse.java index ec8493b..c832571 100644 --- a/src/main/java/com/seam/api/types/NoiseThresholdsCreateResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsSetFanModeResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,20 +11,21 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = NoiseThresholdsCreateResponse.Builder.class) -public final class NoiseThresholdsCreateResponse { +@JsonDeserialize(builder = ThermostatsSetFanModeResponse.Builder.class) +public final class ThermostatsSetFanModeResponse { private final ActionAttempt actionAttempt; private final boolean ok; private final Map additionalProperties; - private NoiseThresholdsCreateResponse( + private ThermostatsSetFanModeResponse( ActionAttempt actionAttempt, boolean ok, Map additionalProperties) { this.actionAttempt = actionAttempt; this.ok = ok; @@ -41,10 +42,10 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof NoiseThresholdsCreateResponse && equalTo((NoiseThresholdsCreateResponse) other); + return other instanceof ThermostatsSetFanModeResponse && equalTo((ThermostatsSetFanModeResponse) other); } @JsonAnyGetter @@ -52,16 +53,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(NoiseThresholdsCreateResponse other) { + private boolean equalTo(ThermostatsSetFanModeResponse other) { return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -73,7 +74,7 @@ public static ActionAttemptStage builder() { public interface ActionAttemptStage { OkStage actionAttempt(ActionAttempt actionAttempt); - Builder from(NoiseThresholdsCreateResponse other); + Builder from(ThermostatsSetFanModeResponse other); } public interface OkStage { @@ -81,7 +82,7 @@ public interface OkStage { } public interface _FinalStage { - NoiseThresholdsCreateResponse build(); + ThermostatsSetFanModeResponse build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -95,30 +96,30 @@ public static final class Builder implements ActionAttemptStage, OkStage, _Final private Builder() {} - @Override - public Builder from(NoiseThresholdsCreateResponse other) { + @java.lang.Override + public Builder from(ThermostatsSetFanModeResponse other) { actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("action_attempt") public OkStage actionAttempt(ActionAttempt actionAttempt) { this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override - public NoiseThresholdsCreateResponse build() { - return new NoiseThresholdsCreateResponse(actionAttempt, ok, additionalProperties); + @java.lang.Override + public ThermostatsSetFanModeResponse build() { + return new ThermostatsSetFanModeResponse(actionAttempt, ok, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/ThermostatsUpdateRequestDefaultClimateSetting.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateRequestDefaultClimateSetting.java similarity index 92% rename from src/main/java/com/seam/api/types/ThermostatsUpdateRequestDefaultClimateSetting.java rename to src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateRequestDefaultClimateSetting.java index b9319b4..e78f982 100644 --- a/src/main/java/com/seam/api/types/ThermostatsUpdateRequestDefaultClimateSetting.java +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateRequestDefaultClimateSetting.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -24,7 +24,7 @@ public final class ThermostatsUpdateRequestDefaultClimateSetting { private final Optional automaticCoolingEnabled; - private final Optional hvacModeSetting; + private final Optional hvacModeSetting; private final Optional coolingSetPointCelsius; @@ -41,7 +41,7 @@ public final class ThermostatsUpdateRequestDefaultClimateSetting { private ThermostatsUpdateRequestDefaultClimateSetting( Optional automaticHeatingEnabled, Optional automaticCoolingEnabled, - Optional hvacModeSetting, + Optional hvacModeSetting, Optional coolingSetPointCelsius, Optional heatingSetPointCelsius, Optional coolingSetPointFahrenheit, @@ -70,7 +70,7 @@ public Optional getAutomaticCoolingEnabled() { } @JsonProperty("hvac_mode_setting") - public Optional getHvacModeSetting() { + public Optional getHvacModeSetting() { return hvacModeSetting; } @@ -99,7 +99,7 @@ public Optional getManualOverrideAllowed() { return manualOverrideAllowed; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsUpdateRequestDefaultClimateSetting @@ -122,7 +122,7 @@ private boolean equalTo(ThermostatsUpdateRequestDefaultClimateSetting other) { && manualOverrideAllowed.equals(other.manualOverrideAllowed); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.automaticHeatingEnabled, @@ -135,7 +135,7 @@ public int hashCode() { this.manualOverrideAllowed); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -150,7 +150,8 @@ public static final class Builder { private Optional automaticCoolingEnabled = Optional.empty(); - private Optional hvacModeSetting = Optional.empty(); + private Optional hvacModeSetting = + Optional.empty(); private Optional coolingSetPointCelsius = Optional.empty(); @@ -202,12 +203,13 @@ public Builder automaticCoolingEnabled(Boolean automaticCoolingEnabled) { } @JsonSetter(value = "hvac_mode_setting", nulls = Nulls.SKIP) - public Builder hvacModeSetting(Optional hvacModeSetting) { + public Builder hvacModeSetting( + Optional hvacModeSetting) { this.hvacModeSetting = hvacModeSetting; return this; } - public Builder hvacModeSetting(HvacModeSetting hvacModeSetting) { + public Builder hvacModeSetting(ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting hvacModeSetting) { this.hvacModeSetting = Optional.of(hvacModeSetting); return this; } diff --git a/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting.java new file mode 100644 index 0000000..6b2a1cf --- /dev/null +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.thermostats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting { + OFF("off"), + + HEAT("heat"), + + COOL("cool"), + + HEAT_COOL("heat_cool"); + + private final String value; + + ThermostatsUpdateRequestDefaultClimateSettingHvacModeSetting(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/ThermostatsUpdateResponse.java b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/ThermostatsUpdateResponse.java rename to src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateResponse.java index 1d5d6d0..b59fe06 100644 --- a/src/main/java/com/seam/api/types/ThermostatsUpdateResponse.java +++ b/src/main/java/com/seam/api/resources/thermostats/types/ThermostatsUpdateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.thermostats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ThermostatsUpdateResponse && equalTo((ThermostatsUpdateResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(ThermostatsUpdateResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(ThermostatsUpdateResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public ThermostatsUpdateResponse build() { return new ThermostatsUpdateResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/useridentities/UserIdentitiesClient.java b/src/main/java/com/seam/api/resources/useridentities/UserIdentitiesClient.java new file mode 100644 index 0000000..5436e72 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/UserIdentitiesClient.java @@ -0,0 +1,736 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.core.Suppliers; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.useridentities.enrollmentautomations.EnrollmentAutomationsClient; +import com.seam.api.resources.useridentities.requests.UserIdentitiesAddAcsUserRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesCreateRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesDeleteRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesGrantAccessToDeviceRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesListAccessibleDevicesRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesListAcsSystemsRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesListAcsUsersRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesListRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesRemoveAcsUserRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesRevokeAccessToDeviceRequest; +import com.seam.api.resources.useridentities.requests.UserIdentitiesUpdateRequest; +import com.seam.api.resources.useridentities.types.UserIdentitiesAddAcsUserResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesCreateResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesDeleteResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesGetRequest; +import com.seam.api.resources.useridentities.types.UserIdentitiesGetResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesGrantAccessToDeviceResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesListAccessibleDevicesResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesListAcsSystemsResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesListAcsUsersResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesListResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesRemoveAcsUserResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesRevokeAccessToDeviceResponse; +import com.seam.api.resources.useridentities.types.UserIdentitiesUpdateResponse; +import com.seam.api.types.AcsSystem; +import com.seam.api.types.AcsUser; +import com.seam.api.types.Device; +import com.seam.api.types.UserIdentity; +import java.io.IOException; +import java.util.List; +import java.util.function.Supplier; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class UserIdentitiesClient { + protected final ClientOptions clientOptions; + + protected final Supplier enrollmentAutomationsClient; + + public UserIdentitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.enrollmentAutomationsClient = Suppliers.memoize(() -> new EnrollmentAutomationsClient(clientOptions)); + } + + public UserIdentitiesAddAcsUserResponse addAcsUser(UserIdentitiesAddAcsUserRequest request) { + return addAcsUser(request, null); + } + + public UserIdentitiesAddAcsUserResponse addAcsUser( + UserIdentitiesAddAcsUserRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/add_acs_user") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UserIdentitiesAddAcsUserResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UserIdentity create() { + return create(UserIdentitiesCreateRequest.builder().build()); + } + + public UserIdentity create(UserIdentitiesCreateRequest request) { + return create(request, null); + } + + public UserIdentity create(UserIdentitiesCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/create") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UserIdentitiesCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UserIdentitiesCreateResponse.class); + return parsedResponse.getUserIdentity(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UserIdentitiesDeleteResponse delete(UserIdentitiesDeleteRequest request) { + return delete(request, null); + } + + public UserIdentitiesDeleteResponse delete(UserIdentitiesDeleteRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/delete") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UserIdentitiesDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UserIdentity get(UserIdentitiesGetRequest request) { + return get(request, null); + } + + public UserIdentity get(UserIdentitiesGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UserIdentitiesGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UserIdentitiesGetResponse.class); + return parsedResponse.getUserIdentity(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UserIdentitiesGrantAccessToDeviceResponse grantAccessToDevice( + UserIdentitiesGrantAccessToDeviceRequest request) { + return grantAccessToDevice(request, null); + } + + public UserIdentitiesGrantAccessToDeviceResponse grantAccessToDevice( + UserIdentitiesGrantAccessToDeviceRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/grant_access_to_device") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UserIdentitiesGrantAccessToDeviceResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list() { + return list(UserIdentitiesListRequest.builder().build()); + } + + public List list(UserIdentitiesListRequest request) { + return list(request, null); + } + + public List list(UserIdentitiesListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UserIdentitiesListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UserIdentitiesListResponse.class); + return parsedResponse.getUserIdentities(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listAccessibleDevices(UserIdentitiesListAccessibleDevicesRequest request) { + return listAccessibleDevices(request, null); + } + + public List listAccessibleDevices( + UserIdentitiesListAccessibleDevicesRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/list_accessible_devices") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UserIdentitiesListAccessibleDevicesResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UserIdentitiesListAccessibleDevicesResponse.class); + return parsedResponse.getDevices(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listAcsSystems(UserIdentitiesListAcsSystemsRequest request) { + return listAcsSystems(request, null); + } + + public List listAcsSystems(UserIdentitiesListAcsSystemsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/list_acs_systems") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UserIdentitiesListAcsSystemsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UserIdentitiesListAcsSystemsResponse.class); + return parsedResponse.getAcsSystems(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List listAcsUsers(UserIdentitiesListAcsUsersRequest request) { + return listAcsUsers(request, null); + } + + public List listAcsUsers(UserIdentitiesListAcsUsersRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/list_acs_users") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + UserIdentitiesListAcsUsersResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UserIdentitiesListAcsUsersResponse.class); + return parsedResponse.getAcsUsers(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UserIdentitiesRemoveAcsUserResponse removeAcsUser(UserIdentitiesRemoveAcsUserRequest request) { + return removeAcsUser(request, null); + } + + public UserIdentitiesRemoveAcsUserResponse removeAcsUser( + UserIdentitiesRemoveAcsUserRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/remove_acs_user") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UserIdentitiesRemoveAcsUserResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UserIdentitiesRevokeAccessToDeviceResponse revokeAccessToDevice( + UserIdentitiesRevokeAccessToDeviceRequest request) { + return revokeAccessToDevice(request, null); + } + + public UserIdentitiesRevokeAccessToDeviceResponse revokeAccessToDevice( + UserIdentitiesRevokeAccessToDeviceRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/revoke_access_to_device") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), UserIdentitiesRevokeAccessToDeviceResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public UserIdentitiesUpdateResponse update(UserIdentitiesUpdateRequest request) { + return update(request, null); + } + + public UserIdentitiesUpdateResponse update(UserIdentitiesUpdateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/update") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UserIdentitiesUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public EnrollmentAutomationsClient enrollmentAutomations() { + return this.enrollmentAutomationsClient.get(); + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/EnrollmentAutomationsClient.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/EnrollmentAutomationsClient.java new file mode 100644 index 0000000..37f8d56 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/EnrollmentAutomationsClient.java @@ -0,0 +1,262 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; +import com.seam.api.core.ObjectMappers; +import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.useridentities.enrollmentautomations.requests.EnrollmentAutomationsDeleteRequest; +import com.seam.api.resources.useridentities.enrollmentautomations.requests.EnrollmentAutomationsGetRequest; +import com.seam.api.resources.useridentities.enrollmentautomations.requests.EnrollmentAutomationsLaunchRequest; +import com.seam.api.resources.useridentities.enrollmentautomations.requests.EnrollmentAutomationsListRequest; +import com.seam.api.resources.useridentities.enrollmentautomations.types.EnrollmentAutomationsDeleteResponse; +import com.seam.api.resources.useridentities.enrollmentautomations.types.EnrollmentAutomationsGetResponse; +import com.seam.api.resources.useridentities.enrollmentautomations.types.EnrollmentAutomationsLaunchResponse; +import com.seam.api.resources.useridentities.enrollmentautomations.types.EnrollmentAutomationsLaunchResponseEnrollmentAutomation; +import com.seam.api.resources.useridentities.enrollmentautomations.types.EnrollmentAutomationsListResponse; +import com.seam.api.types.EnrollmentAutomation; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class EnrollmentAutomationsClient { + protected final ClientOptions clientOptions; + + public EnrollmentAutomationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public EnrollmentAutomationsDeleteResponse delete(EnrollmentAutomationsDeleteRequest request) { + return delete(request, null); + } + + public EnrollmentAutomationsDeleteResponse delete( + EnrollmentAutomationsDeleteRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/enrollment_automations/delete") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), EnrollmentAutomationsDeleteResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public EnrollmentAutomation get(EnrollmentAutomationsGetRequest request) { + return get(request, null); + } + + public EnrollmentAutomation get(EnrollmentAutomationsGetRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/enrollment_automations/get") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + EnrollmentAutomationsGetResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), EnrollmentAutomationsGetResponse.class); + return parsedResponse.getEnrollmentAutomation(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public EnrollmentAutomationsLaunchResponseEnrollmentAutomation launch(EnrollmentAutomationsLaunchRequest request) { + return launch(request, null); + } + + public EnrollmentAutomationsLaunchResponseEnrollmentAutomation launch( + EnrollmentAutomationsLaunchRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/enrollment_automations/launch") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + EnrollmentAutomationsLaunchResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), EnrollmentAutomationsLaunchResponse.class); + return parsedResponse.getEnrollmentAutomation(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public List list(EnrollmentAutomationsListRequest request) { + return list(request, null); + } + + public List list(EnrollmentAutomationsListRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("user_identities/enrollment_automations/list") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + EnrollmentAutomationsListResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), EnrollmentAutomationsListResponse.class); + return parsedResponse.getEnrollmentAutomations(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsDeleteRequest.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsDeleteRequest.java new file mode 100644 index 0000000..85a5038 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsDeleteRequest.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsDeleteRequest.Builder.class) +public final class EnrollmentAutomationsDeleteRequest { + private final String enrollmentAutomationId; + + private final Map additionalProperties; + + private EnrollmentAutomationsDeleteRequest( + String enrollmentAutomationId, Map additionalProperties) { + this.enrollmentAutomationId = enrollmentAutomationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enrollment_automation_id") + public String getEnrollmentAutomationId() { + return enrollmentAutomationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsDeleteRequest + && equalTo((EnrollmentAutomationsDeleteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsDeleteRequest other) { + return enrollmentAutomationId.equals(other.enrollmentAutomationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentAutomationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentAutomationIdStage builder() { + return new Builder(); + } + + public interface EnrollmentAutomationIdStage { + _FinalStage enrollmentAutomationId(String enrollmentAutomationId); + + Builder from(EnrollmentAutomationsDeleteRequest other); + } + + public interface _FinalStage { + EnrollmentAutomationsDeleteRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentAutomationIdStage, _FinalStage { + private String enrollmentAutomationId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsDeleteRequest other) { + enrollmentAutomationId(other.getEnrollmentAutomationId()); + return this; + } + + @java.lang.Override + @JsonSetter("enrollment_automation_id") + public _FinalStage enrollmentAutomationId(String enrollmentAutomationId) { + this.enrollmentAutomationId = enrollmentAutomationId; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsDeleteRequest build() { + return new EnrollmentAutomationsDeleteRequest(enrollmentAutomationId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsGetRequest.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsGetRequest.java new file mode 100644 index 0000000..d7548e0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsGetRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsGetRequest.Builder.class) +public final class EnrollmentAutomationsGetRequest { + private final String enrollmentAutomationId; + + private final Map additionalProperties; + + private EnrollmentAutomationsGetRequest(String enrollmentAutomationId, Map additionalProperties) { + this.enrollmentAutomationId = enrollmentAutomationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enrollment_automation_id") + public String getEnrollmentAutomationId() { + return enrollmentAutomationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsGetRequest && equalTo((EnrollmentAutomationsGetRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsGetRequest other) { + return enrollmentAutomationId.equals(other.enrollmentAutomationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentAutomationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentAutomationIdStage builder() { + return new Builder(); + } + + public interface EnrollmentAutomationIdStage { + _FinalStage enrollmentAutomationId(String enrollmentAutomationId); + + Builder from(EnrollmentAutomationsGetRequest other); + } + + public interface _FinalStage { + EnrollmentAutomationsGetRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentAutomationIdStage, _FinalStage { + private String enrollmentAutomationId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsGetRequest other) { + enrollmentAutomationId(other.getEnrollmentAutomationId()); + return this; + } + + @java.lang.Override + @JsonSetter("enrollment_automation_id") + public _FinalStage enrollmentAutomationId(String enrollmentAutomationId) { + this.enrollmentAutomationId = enrollmentAutomationId; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsGetRequest build() { + return new EnrollmentAutomationsGetRequest(enrollmentAutomationId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsLaunchRequest.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsLaunchRequest.java new file mode 100644 index 0000000..7cb9efd --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsLaunchRequest.java @@ -0,0 +1,231 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsLaunchRequest.Builder.class) +public final class EnrollmentAutomationsLaunchRequest { + private final String userIdentityId; + + private final String credentialManagerAcsSystemId; + + private final Optional acsCredentialPoolId; + + private final Optional createCredentialManagerUser; + + private final Optional credentialManagerAcsUserId; + + private final Map additionalProperties; + + private EnrollmentAutomationsLaunchRequest( + String userIdentityId, + String credentialManagerAcsSystemId, + Optional acsCredentialPoolId, + Optional createCredentialManagerUser, + Optional credentialManagerAcsUserId, + Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + this.acsCredentialPoolId = acsCredentialPoolId; + this.createCredentialManagerUser = createCredentialManagerUser; + this.credentialManagerAcsUserId = credentialManagerAcsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("credential_manager_acs_system_id") + public String getCredentialManagerAcsSystemId() { + return credentialManagerAcsSystemId; + } + + @JsonProperty("acs_credential_pool_id") + public Optional getAcsCredentialPoolId() { + return acsCredentialPoolId; + } + + @JsonProperty("create_credential_manager_user") + public Optional getCreateCredentialManagerUser() { + return createCredentialManagerUser; + } + + @JsonProperty("credential_manager_acs_user_id") + public Optional getCredentialManagerAcsUserId() { + return credentialManagerAcsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsLaunchRequest + && equalTo((EnrollmentAutomationsLaunchRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsLaunchRequest other) { + return userIdentityId.equals(other.userIdentityId) + && credentialManagerAcsSystemId.equals(other.credentialManagerAcsSystemId) + && acsCredentialPoolId.equals(other.acsCredentialPoolId) + && createCredentialManagerUser.equals(other.createCredentialManagerUser) + && credentialManagerAcsUserId.equals(other.credentialManagerAcsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userIdentityId, + this.credentialManagerAcsSystemId, + this.acsCredentialPoolId, + this.createCredentialManagerUser, + this.credentialManagerAcsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + CredentialManagerAcsSystemIdStage userIdentityId(String userIdentityId); + + Builder from(EnrollmentAutomationsLaunchRequest other); + } + + public interface CredentialManagerAcsSystemIdStage { + _FinalStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId); + } + + public interface _FinalStage { + EnrollmentAutomationsLaunchRequest build(); + + _FinalStage acsCredentialPoolId(Optional acsCredentialPoolId); + + _FinalStage acsCredentialPoolId(String acsCredentialPoolId); + + _FinalStage createCredentialManagerUser(Optional createCredentialManagerUser); + + _FinalStage createCredentialManagerUser(Boolean createCredentialManagerUser); + + _FinalStage credentialManagerAcsUserId(Optional credentialManagerAcsUserId); + + _FinalStage credentialManagerAcsUserId(String credentialManagerAcsUserId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, CredentialManagerAcsSystemIdStage, _FinalStage { + private String userIdentityId; + + private String credentialManagerAcsSystemId; + + private Optional credentialManagerAcsUserId = Optional.empty(); + + private Optional createCredentialManagerUser = Optional.empty(); + + private Optional acsCredentialPoolId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsLaunchRequest other) { + userIdentityId(other.getUserIdentityId()); + credentialManagerAcsSystemId(other.getCredentialManagerAcsSystemId()); + acsCredentialPoolId(other.getAcsCredentialPoolId()); + createCredentialManagerUser(other.getCreateCredentialManagerUser()); + credentialManagerAcsUserId(other.getCredentialManagerAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public CredentialManagerAcsSystemIdStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("credential_manager_acs_system_id") + public _FinalStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + return this; + } + + @java.lang.Override + public _FinalStage credentialManagerAcsUserId(String credentialManagerAcsUserId) { + this.credentialManagerAcsUserId = Optional.of(credentialManagerAcsUserId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "credential_manager_acs_user_id", nulls = Nulls.SKIP) + public _FinalStage credentialManagerAcsUserId(Optional credentialManagerAcsUserId) { + this.credentialManagerAcsUserId = credentialManagerAcsUserId; + return this; + } + + @java.lang.Override + public _FinalStage createCredentialManagerUser(Boolean createCredentialManagerUser) { + this.createCredentialManagerUser = Optional.of(createCredentialManagerUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "create_credential_manager_user", nulls = Nulls.SKIP) + public _FinalStage createCredentialManagerUser(Optional createCredentialManagerUser) { + this.createCredentialManagerUser = createCredentialManagerUser; + return this; + } + + @java.lang.Override + public _FinalStage acsCredentialPoolId(String acsCredentialPoolId) { + this.acsCredentialPoolId = Optional.of(acsCredentialPoolId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_credential_pool_id", nulls = Nulls.SKIP) + public _FinalStage acsCredentialPoolId(Optional acsCredentialPoolId) { + this.acsCredentialPoolId = acsCredentialPoolId; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsLaunchRequest build() { + return new EnrollmentAutomationsLaunchRequest( + userIdentityId, + credentialManagerAcsSystemId, + acsCredentialPoolId, + createCredentialManagerUser, + credentialManagerAcsUserId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsListRequest.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsListRequest.java new file mode 100644 index 0000000..39164c7 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/requests/EnrollmentAutomationsListRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsListRequest.Builder.class) +public final class EnrollmentAutomationsListRequest { + private final String userIdentityId; + + private final Map additionalProperties; + + private EnrollmentAutomationsListRequest(String userIdentityId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsListRequest && equalTo((EnrollmentAutomationsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsListRequest other) { + return userIdentityId.equals(other.userIdentityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(EnrollmentAutomationsListRequest other); + } + + public interface _FinalStage { + EnrollmentAutomationsListRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsListRequest other) { + userIdentityId(other.getUserIdentityId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsListRequest build() { + return new EnrollmentAutomationsListRequest(userIdentityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsDeleteResponse.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsDeleteResponse.java new file mode 100644 index 0000000..8a58ac6 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsDeleteResponse.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsDeleteResponse.Builder.class) +public final class EnrollmentAutomationsDeleteResponse { + private final boolean ok; + + private final Map additionalProperties; + + private EnrollmentAutomationsDeleteResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsDeleteResponse + && equalTo((EnrollmentAutomationsDeleteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsDeleteResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(EnrollmentAutomationsDeleteResponse other); + } + + public interface _FinalStage { + EnrollmentAutomationsDeleteResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsDeleteResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsDeleteResponse build() { + return new EnrollmentAutomationsDeleteResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsGetResponse.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsGetResponse.java new file mode 100644 index 0000000..eec80aa --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsGetResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.EnrollmentAutomation; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsGetResponse.Builder.class) +public final class EnrollmentAutomationsGetResponse { + private final EnrollmentAutomation enrollmentAutomation; + + private final boolean ok; + + private final Map additionalProperties; + + private EnrollmentAutomationsGetResponse( + EnrollmentAutomation enrollmentAutomation, boolean ok, Map additionalProperties) { + this.enrollmentAutomation = enrollmentAutomation; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enrollment_automation") + public EnrollmentAutomation getEnrollmentAutomation() { + return enrollmentAutomation; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsGetResponse && equalTo((EnrollmentAutomationsGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsGetResponse other) { + return enrollmentAutomation.equals(other.enrollmentAutomation) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentAutomation, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentAutomationStage builder() { + return new Builder(); + } + + public interface EnrollmentAutomationStage { + OkStage enrollmentAutomation(EnrollmentAutomation enrollmentAutomation); + + Builder from(EnrollmentAutomationsGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + EnrollmentAutomationsGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentAutomationStage, OkStage, _FinalStage { + private EnrollmentAutomation enrollmentAutomation; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsGetResponse other) { + enrollmentAutomation(other.getEnrollmentAutomation()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("enrollment_automation") + public OkStage enrollmentAutomation(EnrollmentAutomation enrollmentAutomation) { + this.enrollmentAutomation = enrollmentAutomation; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsGetResponse build() { + return new EnrollmentAutomationsGetResponse(enrollmentAutomation, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponse.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponse.java new file mode 100644 index 0000000..d5e07e0 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponse.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsLaunchResponse.Builder.class) +public final class EnrollmentAutomationsLaunchResponse { + private final EnrollmentAutomationsLaunchResponseEnrollmentAutomation enrollmentAutomation; + + private final boolean ok; + + private final Map additionalProperties; + + private EnrollmentAutomationsLaunchResponse( + EnrollmentAutomationsLaunchResponseEnrollmentAutomation enrollmentAutomation, + boolean ok, + Map additionalProperties) { + this.enrollmentAutomation = enrollmentAutomation; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enrollment_automation") + public EnrollmentAutomationsLaunchResponseEnrollmentAutomation getEnrollmentAutomation() { + return enrollmentAutomation; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsLaunchResponse + && equalTo((EnrollmentAutomationsLaunchResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsLaunchResponse other) { + return enrollmentAutomation.equals(other.enrollmentAutomation) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentAutomation, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EnrollmentAutomationStage builder() { + return new Builder(); + } + + public interface EnrollmentAutomationStage { + OkStage enrollmentAutomation(EnrollmentAutomationsLaunchResponseEnrollmentAutomation enrollmentAutomation); + + Builder from(EnrollmentAutomationsLaunchResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + EnrollmentAutomationsLaunchResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EnrollmentAutomationStage, OkStage, _FinalStage { + private EnrollmentAutomationsLaunchResponseEnrollmentAutomation enrollmentAutomation; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsLaunchResponse other) { + enrollmentAutomation(other.getEnrollmentAutomation()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("enrollment_automation") + public OkStage enrollmentAutomation( + EnrollmentAutomationsLaunchResponseEnrollmentAutomation enrollmentAutomation) { + this.enrollmentAutomation = enrollmentAutomation; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsLaunchResponse build() { + return new EnrollmentAutomationsLaunchResponse(enrollmentAutomation, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponseEnrollmentAutomation.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponseEnrollmentAutomation.java new file mode 100644 index 0000000..f23d436 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsLaunchResponseEnrollmentAutomation.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsLaunchResponseEnrollmentAutomation.Builder.class) +public final class EnrollmentAutomationsLaunchResponseEnrollmentAutomation { + private final String acsCredentialProvisioningAutomationId; + + private final String credentialManagerAcsSystemId; + + private final String userIdentityId; + + private final OffsetDateTime createdAt; + + private final String workspaceId; + + private final String enrollmentAutomationId; + + private final Map additionalProperties; + + private EnrollmentAutomationsLaunchResponseEnrollmentAutomation( + String acsCredentialProvisioningAutomationId, + String credentialManagerAcsSystemId, + String userIdentityId, + OffsetDateTime createdAt, + String workspaceId, + String enrollmentAutomationId, + Map additionalProperties) { + this.acsCredentialProvisioningAutomationId = acsCredentialProvisioningAutomationId; + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + this.userIdentityId = userIdentityId; + this.createdAt = createdAt; + this.workspaceId = workspaceId; + this.enrollmentAutomationId = enrollmentAutomationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_provisioning_automation_id") + public String getAcsCredentialProvisioningAutomationId() { + return acsCredentialProvisioningAutomationId; + } + + @JsonProperty("credential_manager_acs_system_id") + public String getCredentialManagerAcsSystemId() { + return credentialManagerAcsSystemId; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("enrollment_automation_id") + public String getEnrollmentAutomationId() { + return enrollmentAutomationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsLaunchResponseEnrollmentAutomation + && equalTo((EnrollmentAutomationsLaunchResponseEnrollmentAutomation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsLaunchResponseEnrollmentAutomation other) { + return acsCredentialProvisioningAutomationId.equals(other.acsCredentialProvisioningAutomationId) + && credentialManagerAcsSystemId.equals(other.credentialManagerAcsSystemId) + && userIdentityId.equals(other.userIdentityId) + && createdAt.equals(other.createdAt) + && workspaceId.equals(other.workspaceId) + && enrollmentAutomationId.equals(other.enrollmentAutomationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsCredentialProvisioningAutomationId, + this.credentialManagerAcsSystemId, + this.userIdentityId, + this.createdAt, + this.workspaceId, + this.enrollmentAutomationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialProvisioningAutomationIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialProvisioningAutomationIdStage { + CredentialManagerAcsSystemIdStage acsCredentialProvisioningAutomationId( + String acsCredentialProvisioningAutomationId); + + Builder from(EnrollmentAutomationsLaunchResponseEnrollmentAutomation other); + } + + public interface CredentialManagerAcsSystemIdStage { + UserIdentityIdStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId); + } + + public interface UserIdentityIdStage { + CreatedAtStage userIdentityId(String userIdentityId); + } + + public interface CreatedAtStage { + WorkspaceIdStage createdAt(OffsetDateTime createdAt); + } + + public interface WorkspaceIdStage { + EnrollmentAutomationIdStage workspaceId(String workspaceId); + } + + public interface EnrollmentAutomationIdStage { + _FinalStage enrollmentAutomationId(String enrollmentAutomationId); + } + + public interface _FinalStage { + EnrollmentAutomationsLaunchResponseEnrollmentAutomation build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsCredentialProvisioningAutomationIdStage, + CredentialManagerAcsSystemIdStage, + UserIdentityIdStage, + CreatedAtStage, + WorkspaceIdStage, + EnrollmentAutomationIdStage, + _FinalStage { + private String acsCredentialProvisioningAutomationId; + + private String credentialManagerAcsSystemId; + + private String userIdentityId; + + private OffsetDateTime createdAt; + + private String workspaceId; + + private String enrollmentAutomationId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsLaunchResponseEnrollmentAutomation other) { + acsCredentialProvisioningAutomationId(other.getAcsCredentialProvisioningAutomationId()); + credentialManagerAcsSystemId(other.getCredentialManagerAcsSystemId()); + userIdentityId(other.getUserIdentityId()); + createdAt(other.getCreatedAt()); + workspaceId(other.getWorkspaceId()); + enrollmentAutomationId(other.getEnrollmentAutomationId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_provisioning_automation_id") + public CredentialManagerAcsSystemIdStage acsCredentialProvisioningAutomationId( + String acsCredentialProvisioningAutomationId) { + this.acsCredentialProvisioningAutomationId = acsCredentialProvisioningAutomationId; + return this; + } + + @java.lang.Override + @JsonSetter("credential_manager_acs_system_id") + public UserIdentityIdStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public CreatedAtStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public WorkspaceIdStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public EnrollmentAutomationIdStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + @JsonSetter("enrollment_automation_id") + public _FinalStage enrollmentAutomationId(String enrollmentAutomationId) { + this.enrollmentAutomationId = enrollmentAutomationId; + return this; + } + + @java.lang.Override + public EnrollmentAutomationsLaunchResponseEnrollmentAutomation build() { + return new EnrollmentAutomationsLaunchResponseEnrollmentAutomation( + acsCredentialProvisioningAutomationId, + credentialManagerAcsSystemId, + userIdentityId, + createdAt, + workspaceId, + enrollmentAutomationId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsListResponse.java b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsListResponse.java new file mode 100644 index 0000000..6ba5fa4 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/enrollmentautomations/types/EnrollmentAutomationsListResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.enrollmentautomations.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.EnrollmentAutomation; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomationsListResponse.Builder.class) +public final class EnrollmentAutomationsListResponse { + private final List enrollmentAutomations; + + private final boolean ok; + + private final Map additionalProperties; + + private EnrollmentAutomationsListResponse( + List enrollmentAutomations, boolean ok, Map additionalProperties) { + this.enrollmentAutomations = enrollmentAutomations; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enrollment_automations") + public List getEnrollmentAutomations() { + return enrollmentAutomations; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomationsListResponse && equalTo((EnrollmentAutomationsListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomationsListResponse other) { + return enrollmentAutomations.equals(other.enrollmentAutomations) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enrollmentAutomations, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(EnrollmentAutomationsListResponse other); + } + + public interface _FinalStage { + EnrollmentAutomationsListResponse build(); + + _FinalStage enrollmentAutomations(List enrollmentAutomations); + + _FinalStage addEnrollmentAutomations(EnrollmentAutomation enrollmentAutomations); + + _FinalStage addAllEnrollmentAutomations(List enrollmentAutomations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List enrollmentAutomations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomationsListResponse other) { + enrollmentAutomations(other.getEnrollmentAutomations()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllEnrollmentAutomations(List enrollmentAutomations) { + this.enrollmentAutomations.addAll(enrollmentAutomations); + return this; + } + + @java.lang.Override + public _FinalStage addEnrollmentAutomations(EnrollmentAutomation enrollmentAutomations) { + this.enrollmentAutomations.add(enrollmentAutomations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enrollment_automations", nulls = Nulls.SKIP) + public _FinalStage enrollmentAutomations(List enrollmentAutomations) { + this.enrollmentAutomations.clear(); + this.enrollmentAutomations.addAll(enrollmentAutomations); + return this; + } + + @java.lang.Override + public EnrollmentAutomationsListResponse build() { + return new EnrollmentAutomationsListResponse(enrollmentAutomations, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesAddAcsUserRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesAddAcsUserRequest.java new file mode 100644 index 0000000..8959de2 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesAddAcsUserRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesAddAcsUserRequest.Builder.class) +public final class UserIdentitiesAddAcsUserRequest { + private final String userIdentityId; + + private final String acsUserId; + + private final Map additionalProperties; + + private UserIdentitiesAddAcsUserRequest( + String userIdentityId, String acsUserId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesAddAcsUserRequest && equalTo((UserIdentitiesAddAcsUserRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesAddAcsUserRequest other) { + return userIdentityId.equals(other.userIdentityId) && acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId, this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + AcsUserIdStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesAddAcsUserRequest other); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + } + + public interface _FinalStage { + UserIdentitiesAddAcsUserRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, AcsUserIdStage, _FinalStage { + private String userIdentityId; + + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesAddAcsUserRequest other) { + userIdentityId(other.getUserIdentityId()); + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public AcsUserIdStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UserIdentitiesAddAcsUserRequest build() { + return new UserIdentitiesAddAcsUserRequest(userIdentityId, acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesCreateRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesCreateRequest.java new file mode 100644 index 0000000..3198228 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesCreateRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesCreateRequest.Builder.class) +public final class UserIdentitiesCreateRequest { + private final Optional userIdentityKey; + + private final Optional emailAddress; + + private final Optional phoneNumber; + + private final Optional fullName; + + private final Map additionalProperties; + + private UserIdentitiesCreateRequest( + Optional userIdentityKey, + Optional emailAddress, + Optional phoneNumber, + Optional fullName, + Map additionalProperties) { + this.userIdentityKey = userIdentityKey; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.fullName = fullName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_key") + public Optional getUserIdentityKey() { + return userIdentityKey; + } + + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("full_name") + public Optional getFullName() { + return fullName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesCreateRequest && equalTo((UserIdentitiesCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesCreateRequest other) { + return userIdentityKey.equals(other.userIdentityKey) + && emailAddress.equals(other.emailAddress) + && phoneNumber.equals(other.phoneNumber) + && fullName.equals(other.fullName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityKey, this.emailAddress, this.phoneNumber, this.fullName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional userIdentityKey = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional fullName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserIdentitiesCreateRequest other) { + userIdentityKey(other.getUserIdentityKey()); + emailAddress(other.getEmailAddress()); + phoneNumber(other.getPhoneNumber()); + fullName(other.getFullName()); + return this; + } + + @JsonSetter(value = "user_identity_key", nulls = Nulls.SKIP) + public Builder userIdentityKey(Optional userIdentityKey) { + this.userIdentityKey = userIdentityKey; + return this; + } + + public Builder userIdentityKey(String userIdentityKey) { + this.userIdentityKey = Optional.of(userIdentityKey); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.of(emailAddress); + return this; + } + + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.of(phoneNumber); + return this; + } + + @JsonSetter(value = "full_name", nulls = Nulls.SKIP) + public Builder fullName(Optional fullName) { + this.fullName = fullName; + return this; + } + + public Builder fullName(String fullName) { + this.fullName = Optional.of(fullName); + return this; + } + + public UserIdentitiesCreateRequest build() { + return new UserIdentitiesCreateRequest( + userIdentityKey, emailAddress, phoneNumber, fullName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesDeleteRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesDeleteRequest.java new file mode 100644 index 0000000..31a7584 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesDeleteRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesDeleteRequest.Builder.class) +public final class UserIdentitiesDeleteRequest { + private final String userIdentityId; + + private final Map additionalProperties; + + private UserIdentitiesDeleteRequest(String userIdentityId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesDeleteRequest && equalTo((UserIdentitiesDeleteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesDeleteRequest other) { + return userIdentityId.equals(other.userIdentityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesDeleteRequest other); + } + + public interface _FinalStage { + UserIdentitiesDeleteRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesDeleteRequest other) { + userIdentityId(other.getUserIdentityId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public UserIdentitiesDeleteRequest build() { + return new UserIdentitiesDeleteRequest(userIdentityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesGrantAccessToDeviceRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesGrantAccessToDeviceRequest.java new file mode 100644 index 0000000..1e35a74 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesGrantAccessToDeviceRequest.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesGrantAccessToDeviceRequest.Builder.class) +public final class UserIdentitiesGrantAccessToDeviceRequest { + private final String userIdentityId; + + private final String deviceId; + + private final Map additionalProperties; + + private UserIdentitiesGrantAccessToDeviceRequest( + String userIdentityId, String deviceId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesGrantAccessToDeviceRequest + && equalTo((UserIdentitiesGrantAccessToDeviceRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesGrantAccessToDeviceRequest other) { + return userIdentityId.equals(other.userIdentityId) && deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId, this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + DeviceIdStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesGrantAccessToDeviceRequest other); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + } + + public interface _FinalStage { + UserIdentitiesGrantAccessToDeviceRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, DeviceIdStage, _FinalStage { + private String userIdentityId; + + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesGrantAccessToDeviceRequest other) { + userIdentityId(other.getUserIdentityId()); + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public DeviceIdStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public UserIdentitiesGrantAccessToDeviceRequest build() { + return new UserIdentitiesGrantAccessToDeviceRequest(userIdentityId, deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAccessibleDevicesRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAccessibleDevicesRequest.java new file mode 100644 index 0000000..02bb939 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAccessibleDevicesRequest.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListAccessibleDevicesRequest.Builder.class) +public final class UserIdentitiesListAccessibleDevicesRequest { + private final String userIdentityId; + + private final Map additionalProperties; + + private UserIdentitiesListAccessibleDevicesRequest( + String userIdentityId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListAccessibleDevicesRequest + && equalTo((UserIdentitiesListAccessibleDevicesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListAccessibleDevicesRequest other) { + return userIdentityId.equals(other.userIdentityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesListAccessibleDevicesRequest other); + } + + public interface _FinalStage { + UserIdentitiesListAccessibleDevicesRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesListAccessibleDevicesRequest other) { + userIdentityId(other.getUserIdentityId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public UserIdentitiesListAccessibleDevicesRequest build() { + return new UserIdentitiesListAccessibleDevicesRequest(userIdentityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsSystemsRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsSystemsRequest.java new file mode 100644 index 0000000..1620772 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsSystemsRequest.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListAcsSystemsRequest.Builder.class) +public final class UserIdentitiesListAcsSystemsRequest { + private final String userIdentityId; + + private final Map additionalProperties; + + private UserIdentitiesListAcsSystemsRequest(String userIdentityId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListAcsSystemsRequest + && equalTo((UserIdentitiesListAcsSystemsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListAcsSystemsRequest other) { + return userIdentityId.equals(other.userIdentityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesListAcsSystemsRequest other); + } + + public interface _FinalStage { + UserIdentitiesListAcsSystemsRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesListAcsSystemsRequest other) { + userIdentityId(other.getUserIdentityId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public UserIdentitiesListAcsSystemsRequest build() { + return new UserIdentitiesListAcsSystemsRequest(userIdentityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsUsersRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsUsersRequest.java new file mode 100644 index 0000000..137c72f --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListAcsUsersRequest.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListAcsUsersRequest.Builder.class) +public final class UserIdentitiesListAcsUsersRequest { + private final String userIdentityId; + + private final Map additionalProperties; + + private UserIdentitiesListAcsUsersRequest(String userIdentityId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListAcsUsersRequest && equalTo((UserIdentitiesListAcsUsersRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListAcsUsersRequest other) { + return userIdentityId.equals(other.userIdentityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesListAcsUsersRequest other); + } + + public interface _FinalStage { + UserIdentitiesListAcsUsersRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesListAcsUsersRequest other) { + userIdentityId(other.getUserIdentityId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public UserIdentitiesListAcsUsersRequest build() { + return new UserIdentitiesListAcsUsersRequest(userIdentityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListRequest.java new file mode 100644 index 0000000..a2d10fc --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesListRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListRequest.Builder.class) +public final class UserIdentitiesListRequest { + private final Optional credentialManagerAcsSystemId; + + private final Map additionalProperties; + + private UserIdentitiesListRequest( + Optional credentialManagerAcsSystemId, Map additionalProperties) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("credential_manager_acs_system_id") + public Optional getCredentialManagerAcsSystemId() { + return credentialManagerAcsSystemId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListRequest && equalTo((UserIdentitiesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListRequest other) { + return credentialManagerAcsSystemId.equals(other.credentialManagerAcsSystemId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.credentialManagerAcsSystemId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional credentialManagerAcsSystemId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserIdentitiesListRequest other) { + credentialManagerAcsSystemId(other.getCredentialManagerAcsSystemId()); + return this; + } + + @JsonSetter(value = "credential_manager_acs_system_id", nulls = Nulls.SKIP) + public Builder credentialManagerAcsSystemId(Optional credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + return this; + } + + public Builder credentialManagerAcsSystemId(String credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = Optional.of(credentialManagerAcsSystemId); + return this; + } + + public UserIdentitiesListRequest build() { + return new UserIdentitiesListRequest(credentialManagerAcsSystemId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRemoveAcsUserRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRemoveAcsUserRequest.java new file mode 100644 index 0000000..af072c2 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRemoveAcsUserRequest.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesRemoveAcsUserRequest.Builder.class) +public final class UserIdentitiesRemoveAcsUserRequest { + private final String userIdentityId; + + private final String acsUserId; + + private final Map additionalProperties; + + private UserIdentitiesRemoveAcsUserRequest( + String userIdentityId, String acsUserId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.acsUserId = acsUserId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesRemoveAcsUserRequest + && equalTo((UserIdentitiesRemoveAcsUserRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesRemoveAcsUserRequest other) { + return userIdentityId.equals(other.userIdentityId) && acsUserId.equals(other.acsUserId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId, this.acsUserId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + AcsUserIdStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesRemoveAcsUserRequest other); + } + + public interface AcsUserIdStage { + _FinalStage acsUserId(String acsUserId); + } + + public interface _FinalStage { + UserIdentitiesRemoveAcsUserRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, AcsUserIdStage, _FinalStage { + private String userIdentityId; + + private String acsUserId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesRemoveAcsUserRequest other) { + userIdentityId(other.getUserIdentityId()); + acsUserId(other.getAcsUserId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public AcsUserIdStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public UserIdentitiesRemoveAcsUserRequest build() { + return new UserIdentitiesRemoveAcsUserRequest(userIdentityId, acsUserId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRevokeAccessToDeviceRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRevokeAccessToDeviceRequest.java new file mode 100644 index 0000000..4eae561 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesRevokeAccessToDeviceRequest.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesRevokeAccessToDeviceRequest.Builder.class) +public final class UserIdentitiesRevokeAccessToDeviceRequest { + private final String userIdentityId; + + private final String deviceId; + + private final Map additionalProperties; + + private UserIdentitiesRevokeAccessToDeviceRequest( + String userIdentityId, String deviceId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesRevokeAccessToDeviceRequest + && equalTo((UserIdentitiesRevokeAccessToDeviceRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesRevokeAccessToDeviceRequest other) { + return userIdentityId.equals(other.userIdentityId) && deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId, this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + DeviceIdStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesRevokeAccessToDeviceRequest other); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + } + + public interface _FinalStage { + UserIdentitiesRevokeAccessToDeviceRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, DeviceIdStage, _FinalStage { + private String userIdentityId; + + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesRevokeAccessToDeviceRequest other) { + userIdentityId(other.getUserIdentityId()); + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public DeviceIdStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public UserIdentitiesRevokeAccessToDeviceRequest build() { + return new UserIdentitiesRevokeAccessToDeviceRequest(userIdentityId, deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesUpdateRequest.java b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesUpdateRequest.java new file mode 100644 index 0000000..443d18f --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/requests/UserIdentitiesUpdateRequest.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesUpdateRequest.Builder.class) +public final class UserIdentitiesUpdateRequest { + private final String userIdentityId; + + private final Optional userIdentityKey; + + private final Optional emailAddress; + + private final Optional phoneNumber; + + private final Optional fullName; + + private final Map additionalProperties; + + private UserIdentitiesUpdateRequest( + String userIdentityId, + Optional userIdentityKey, + Optional emailAddress, + Optional phoneNumber, + Optional fullName, + Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.userIdentityKey = userIdentityKey; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.fullName = fullName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("user_identity_key") + public Optional getUserIdentityKey() { + return userIdentityKey; + } + + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("full_name") + public Optional getFullName() { + return fullName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesUpdateRequest && equalTo((UserIdentitiesUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesUpdateRequest other) { + return userIdentityId.equals(other.userIdentityId) + && userIdentityKey.equals(other.userIdentityKey) + && emailAddress.equals(other.emailAddress) + && phoneNumber.equals(other.phoneNumber) + && fullName.equals(other.fullName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userIdentityId, this.userIdentityKey, this.emailAddress, this.phoneNumber, this.fullName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesUpdateRequest other); + } + + public interface _FinalStage { + UserIdentitiesUpdateRequest build(); + + _FinalStage userIdentityKey(Optional userIdentityKey); + + _FinalStage userIdentityKey(String userIdentityKey); + + _FinalStage emailAddress(Optional emailAddress); + + _FinalStage emailAddress(String emailAddress); + + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + _FinalStage fullName(Optional fullName); + + _FinalStage fullName(String fullName); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + private Optional fullName = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional userIdentityKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesUpdateRequest other) { + userIdentityId(other.getUserIdentityId()); + userIdentityKey(other.getUserIdentityKey()); + emailAddress(other.getEmailAddress()); + phoneNumber(other.getPhoneNumber()); + fullName(other.getFullName()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public _FinalStage fullName(String fullName) { + this.fullName = Optional.of(fullName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "full_name", nulls = Nulls.SKIP) + public _FinalStage fullName(Optional fullName) { + this.fullName = fullName; + return this; + } + + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.of(phoneNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + @java.lang.Override + public _FinalStage emailAddress(String emailAddress) { + this.emailAddress = Optional.of(emailAddress); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public _FinalStage emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + @java.lang.Override + public _FinalStage userIdentityKey(String userIdentityKey) { + this.userIdentityKey = Optional.of(userIdentityKey); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_key", nulls = Nulls.SKIP) + public _FinalStage userIdentityKey(Optional userIdentityKey) { + this.userIdentityKey = userIdentityKey; + return this; + } + + @java.lang.Override + public UserIdentitiesUpdateRequest build() { + return new UserIdentitiesUpdateRequest( + userIdentityId, userIdentityKey, emailAddress, phoneNumber, fullName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesAddAcsUserResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesAddAcsUserResponse.java new file mode 100644 index 0000000..4ae1aa8 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesAddAcsUserResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesAddAcsUserResponse.Builder.class) +public final class UserIdentitiesAddAcsUserResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesAddAcsUserResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesAddAcsUserResponse && equalTo((UserIdentitiesAddAcsUserResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesAddAcsUserResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesAddAcsUserResponse other); + } + + public interface _FinalStage { + UserIdentitiesAddAcsUserResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesAddAcsUserResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesAddAcsUserResponse build() { + return new UserIdentitiesAddAcsUserResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesCreateResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesCreateResponse.java new file mode 100644 index 0000000..4cb347b --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesCreateResponse.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UserIdentity; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesCreateResponse.Builder.class) +public final class UserIdentitiesCreateResponse { + private final UserIdentity userIdentity; + + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesCreateResponse( + UserIdentity userIdentity, boolean ok, Map additionalProperties) { + this.userIdentity = userIdentity; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity") + public UserIdentity getUserIdentity() { + return userIdentity; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesCreateResponse && equalTo((UserIdentitiesCreateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesCreateResponse other) { + return userIdentity.equals(other.userIdentity) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentity, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityStage builder() { + return new Builder(); + } + + public interface UserIdentityStage { + OkStage userIdentity(UserIdentity userIdentity); + + Builder from(UserIdentitiesCreateResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + UserIdentitiesCreateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityStage, OkStage, _FinalStage { + private UserIdentity userIdentity; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesCreateResponse other) { + userIdentity(other.getUserIdentity()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity") + public OkStage userIdentity(UserIdentity userIdentity) { + this.userIdentity = userIdentity; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesCreateResponse build() { + return new UserIdentitiesCreateResponse(userIdentity, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesDeleteResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesDeleteResponse.java new file mode 100644 index 0000000..0fd6f4c --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesDeleteResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesDeleteResponse.Builder.class) +public final class UserIdentitiesDeleteResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesDeleteResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesDeleteResponse && equalTo((UserIdentitiesDeleteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesDeleteResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesDeleteResponse other); + } + + public interface _FinalStage { + UserIdentitiesDeleteResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesDeleteResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesDeleteResponse build() { + return new UserIdentitiesDeleteResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequest.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequest.java new file mode 100644 index 0000000..c1baa90 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequest.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UserIdentitiesGetRequest.Deserializer.class) +public final class UserIdentitiesGetRequest { + private final Object value; + + private final int type; + + private UserIdentitiesGetRequest(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((UserIdentitiesGetRequestUserIdentityId) this.value); + } else if (this.type == 1) { + return visitor.visit((UserIdentitiesGetRequestUserIdentityKey) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesGetRequest && equalTo((UserIdentitiesGetRequest) other); + } + + private boolean equalTo(UserIdentitiesGetRequest other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UserIdentitiesGetRequest of(UserIdentitiesGetRequestUserIdentityId value) { + return new UserIdentitiesGetRequest(value, 0); + } + + public static UserIdentitiesGetRequest of(UserIdentitiesGetRequestUserIdentityKey value) { + return new UserIdentitiesGetRequest(value, 1); + } + + public interface Visitor { + T visit(UserIdentitiesGetRequestUserIdentityId value); + + T visit(UserIdentitiesGetRequestUserIdentityKey value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UserIdentitiesGetRequest.class); + } + + @java.lang.Override + public UserIdentitiesGetRequest deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, UserIdentitiesGetRequestUserIdentityId.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, UserIdentitiesGetRequestUserIdentityKey.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityId.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityId.java new file mode 100644 index 0000000..200457a --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityId.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesGetRequestUserIdentityId.Builder.class) +public final class UserIdentitiesGetRequestUserIdentityId { + private final String userIdentityId; + + private final Map additionalProperties; + + private UserIdentitiesGetRequestUserIdentityId(String userIdentityId, Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesGetRequestUserIdentityId + && equalTo((UserIdentitiesGetRequestUserIdentityId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesGetRequestUserIdentityId other) { + return userIdentityId.equals(other.userIdentityId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + _FinalStage userIdentityId(String userIdentityId); + + Builder from(UserIdentitiesGetRequestUserIdentityId other); + } + + public interface _FinalStage { + UserIdentitiesGetRequestUserIdentityId build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityIdStage, _FinalStage { + private String userIdentityId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesGetRequestUserIdentityId other) { + userIdentityId(other.getUserIdentityId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public UserIdentitiesGetRequestUserIdentityId build() { + return new UserIdentitiesGetRequestUserIdentityId(userIdentityId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityKey.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityKey.java new file mode 100644 index 0000000..c11af1d --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetRequestUserIdentityKey.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesGetRequestUserIdentityKey.Builder.class) +public final class UserIdentitiesGetRequestUserIdentityKey { + private final String userIdentityKey; + + private final Map additionalProperties; + + private UserIdentitiesGetRequestUserIdentityKey(String userIdentityKey, Map additionalProperties) { + this.userIdentityKey = userIdentityKey; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_key") + public String getUserIdentityKey() { + return userIdentityKey; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesGetRequestUserIdentityKey + && equalTo((UserIdentitiesGetRequestUserIdentityKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesGetRequestUserIdentityKey other) { + return userIdentityKey.equals(other.userIdentityKey); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentityKey); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityKeyStage builder() { + return new Builder(); + } + + public interface UserIdentityKeyStage { + _FinalStage userIdentityKey(String userIdentityKey); + + Builder from(UserIdentitiesGetRequestUserIdentityKey other); + } + + public interface _FinalStage { + UserIdentitiesGetRequestUserIdentityKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityKeyStage, _FinalStage { + private String userIdentityKey; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesGetRequestUserIdentityKey other) { + userIdentityKey(other.getUserIdentityKey()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_key") + public _FinalStage userIdentityKey(String userIdentityKey) { + this.userIdentityKey = userIdentityKey; + return this; + } + + @java.lang.Override + public UserIdentitiesGetRequestUserIdentityKey build() { + return new UserIdentitiesGetRequestUserIdentityKey(userIdentityKey, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetResponse.java new file mode 100644 index 0000000..2f20e25 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGetResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UserIdentity; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesGetResponse.Builder.class) +public final class UserIdentitiesGetResponse { + private final UserIdentity userIdentity; + + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesGetResponse(UserIdentity userIdentity, boolean ok, Map additionalProperties) { + this.userIdentity = userIdentity; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity") + public UserIdentity getUserIdentity() { + return userIdentity; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesGetResponse && equalTo((UserIdentitiesGetResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesGetResponse other) { + return userIdentity.equals(other.userIdentity) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentity, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityStage builder() { + return new Builder(); + } + + public interface UserIdentityStage { + OkStage userIdentity(UserIdentity userIdentity); + + Builder from(UserIdentitiesGetResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + UserIdentitiesGetResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UserIdentityStage, OkStage, _FinalStage { + private UserIdentity userIdentity; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesGetResponse other) { + userIdentity(other.getUserIdentity()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity") + public OkStage userIdentity(UserIdentity userIdentity) { + this.userIdentity = userIdentity; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesGetResponse build() { + return new UserIdentitiesGetResponse(userIdentity, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGrantAccessToDeviceResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGrantAccessToDeviceResponse.java new file mode 100644 index 0000000..e75fa43 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesGrantAccessToDeviceResponse.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesGrantAccessToDeviceResponse.Builder.class) +public final class UserIdentitiesGrantAccessToDeviceResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesGrantAccessToDeviceResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesGrantAccessToDeviceResponse + && equalTo((UserIdentitiesGrantAccessToDeviceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesGrantAccessToDeviceResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesGrantAccessToDeviceResponse other); + } + + public interface _FinalStage { + UserIdentitiesGrantAccessToDeviceResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesGrantAccessToDeviceResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesGrantAccessToDeviceResponse build() { + return new UserIdentitiesGrantAccessToDeviceResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAccessibleDevicesResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAccessibleDevicesResponse.java new file mode 100644 index 0000000..a99fe19 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAccessibleDevicesResponse.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Device; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListAccessibleDevicesResponse.Builder.class) +public final class UserIdentitiesListAccessibleDevicesResponse { + private final List devices; + + private final List accessibleDevices; + + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesListAccessibleDevicesResponse( + List devices, + List accessibleDevices, + boolean ok, + Map additionalProperties) { + this.devices = devices; + this.accessibleDevices = accessibleDevices; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("devices") + public List getDevices() { + return devices; + } + + @JsonProperty("accessible_devices") + public List getAccessibleDevices() { + return accessibleDevices; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListAccessibleDevicesResponse + && equalTo((UserIdentitiesListAccessibleDevicesResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListAccessibleDevicesResponse other) { + return devices.equals(other.devices) && accessibleDevices.equals(other.accessibleDevices) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.devices, this.accessibleDevices, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesListAccessibleDevicesResponse other); + } + + public interface _FinalStage { + UserIdentitiesListAccessibleDevicesResponse build(); + + _FinalStage devices(List devices); + + _FinalStage addDevices(Device devices); + + _FinalStage addAllDevices(List devices); + + _FinalStage accessibleDevices(List accessibleDevices); + + _FinalStage addAccessibleDevices(Device accessibleDevices); + + _FinalStage addAllAccessibleDevices(List accessibleDevices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List accessibleDevices = new ArrayList<>(); + + private List devices = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesListAccessibleDevicesResponse other) { + devices(other.getDevices()); + accessibleDevices(other.getAccessibleDevices()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAccessibleDevices(List accessibleDevices) { + this.accessibleDevices.addAll(accessibleDevices); + return this; + } + + @java.lang.Override + public _FinalStage addAccessibleDevices(Device accessibleDevices) { + this.accessibleDevices.add(accessibleDevices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "accessible_devices", nulls = Nulls.SKIP) + public _FinalStage accessibleDevices(List accessibleDevices) { + this.accessibleDevices.clear(); + this.accessibleDevices.addAll(accessibleDevices); + return this; + } + + @java.lang.Override + public _FinalStage addAllDevices(List devices) { + this.devices.addAll(devices); + return this; + } + + @java.lang.Override + public _FinalStage addDevices(Device devices) { + this.devices.add(devices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "devices", nulls = Nulls.SKIP) + public _FinalStage devices(List devices) { + this.devices.clear(); + this.devices.addAll(devices); + return this; + } + + @java.lang.Override + public UserIdentitiesListAccessibleDevicesResponse build() { + return new UserIdentitiesListAccessibleDevicesResponse( + devices, accessibleDevices, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsSystemsResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsSystemsResponse.java new file mode 100644 index 0000000..3cb6ad5 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsSystemsResponse.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsSystem; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListAcsSystemsResponse.Builder.class) +public final class UserIdentitiesListAcsSystemsResponse { + private final List acsSystems; + + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesListAcsSystemsResponse( + List acsSystems, boolean ok, Map additionalProperties) { + this.acsSystems = acsSystems; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_systems") + public List getAcsSystems() { + return acsSystems; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListAcsSystemsResponse + && equalTo((UserIdentitiesListAcsSystemsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListAcsSystemsResponse other) { + return acsSystems.equals(other.acsSystems) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsSystems, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesListAcsSystemsResponse other); + } + + public interface _FinalStage { + UserIdentitiesListAcsSystemsResponse build(); + + _FinalStage acsSystems(List acsSystems); + + _FinalStage addAcsSystems(AcsSystem acsSystems); + + _FinalStage addAllAcsSystems(List acsSystems); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsSystems = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesListAcsSystemsResponse other) { + acsSystems(other.getAcsSystems()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsSystems(List acsSystems) { + this.acsSystems.addAll(acsSystems); + return this; + } + + @java.lang.Override + public _FinalStage addAcsSystems(AcsSystem acsSystems) { + this.acsSystems.add(acsSystems); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_systems", nulls = Nulls.SKIP) + public _FinalStage acsSystems(List acsSystems) { + this.acsSystems.clear(); + this.acsSystems.addAll(acsSystems); + return this; + } + + @java.lang.Override + public UserIdentitiesListAcsSystemsResponse build() { + return new UserIdentitiesListAcsSystemsResponse(acsSystems, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsUsersResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsUsersResponse.java new file mode 100644 index 0000000..37b2c7d --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListAcsUsersResponse.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.AcsUser; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListAcsUsersResponse.Builder.class) +public final class UserIdentitiesListAcsUsersResponse { + private final List acsUsers; + + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesListAcsUsersResponse( + List acsUsers, boolean ok, Map additionalProperties) { + this.acsUsers = acsUsers; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_users") + public List getAcsUsers() { + return acsUsers; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListAcsUsersResponse + && equalTo((UserIdentitiesListAcsUsersResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListAcsUsersResponse other) { + return acsUsers.equals(other.acsUsers) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.acsUsers, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesListAcsUsersResponse other); + } + + public interface _FinalStage { + UserIdentitiesListAcsUsersResponse build(); + + _FinalStage acsUsers(List acsUsers); + + _FinalStage addAcsUsers(AcsUser acsUsers); + + _FinalStage addAllAcsUsers(List acsUsers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List acsUsers = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesListAcsUsersResponse other) { + acsUsers(other.getAcsUsers()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllAcsUsers(List acsUsers) { + this.acsUsers.addAll(acsUsers); + return this; + } + + @java.lang.Override + public _FinalStage addAcsUsers(AcsUser acsUsers) { + this.acsUsers.add(acsUsers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_users", nulls = Nulls.SKIP) + public _FinalStage acsUsers(List acsUsers) { + this.acsUsers.clear(); + this.acsUsers.addAll(acsUsers); + return this; + } + + @java.lang.Override + public UserIdentitiesListAcsUsersResponse build() { + return new UserIdentitiesListAcsUsersResponse(acsUsers, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListResponse.java new file mode 100644 index 0000000..8a88e86 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesListResponse.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.UserIdentity; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesListResponse.Builder.class) +public final class UserIdentitiesListResponse { + private final List userIdentities; + + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesListResponse( + List userIdentities, boolean ok, Map additionalProperties) { + this.userIdentities = userIdentities; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identities") + public List getUserIdentities() { + return userIdentities; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesListResponse && equalTo((UserIdentitiesListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesListResponse other) { + return userIdentities.equals(other.userIdentities) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.userIdentities, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesListResponse other); + } + + public interface _FinalStage { + UserIdentitiesListResponse build(); + + _FinalStage userIdentities(List userIdentities); + + _FinalStage addUserIdentities(UserIdentity userIdentities); + + _FinalStage addAllUserIdentities(List userIdentities); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + private List userIdentities = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesListResponse other) { + userIdentities(other.getUserIdentities()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public _FinalStage addAllUserIdentities(List userIdentities) { + this.userIdentities.addAll(userIdentities); + return this; + } + + @java.lang.Override + public _FinalStage addUserIdentities(UserIdentity userIdentities) { + this.userIdentities.add(userIdentities); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identities", nulls = Nulls.SKIP) + public _FinalStage userIdentities(List userIdentities) { + this.userIdentities.clear(); + this.userIdentities.addAll(userIdentities); + return this; + } + + @java.lang.Override + public UserIdentitiesListResponse build() { + return new UserIdentitiesListResponse(userIdentities, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRemoveAcsUserResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRemoveAcsUserResponse.java new file mode 100644 index 0000000..bfcb10b --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRemoveAcsUserResponse.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesRemoveAcsUserResponse.Builder.class) +public final class UserIdentitiesRemoveAcsUserResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesRemoveAcsUserResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesRemoveAcsUserResponse + && equalTo((UserIdentitiesRemoveAcsUserResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesRemoveAcsUserResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesRemoveAcsUserResponse other); + } + + public interface _FinalStage { + UserIdentitiesRemoveAcsUserResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesRemoveAcsUserResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesRemoveAcsUserResponse build() { + return new UserIdentitiesRemoveAcsUserResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRevokeAccessToDeviceResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRevokeAccessToDeviceResponse.java new file mode 100644 index 0000000..b69f038 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesRevokeAccessToDeviceResponse.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesRevokeAccessToDeviceResponse.Builder.class) +public final class UserIdentitiesRevokeAccessToDeviceResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesRevokeAccessToDeviceResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesRevokeAccessToDeviceResponse + && equalTo((UserIdentitiesRevokeAccessToDeviceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesRevokeAccessToDeviceResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesRevokeAccessToDeviceResponse other); + } + + public interface _FinalStage { + UserIdentitiesRevokeAccessToDeviceResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesRevokeAccessToDeviceResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesRevokeAccessToDeviceResponse build() { + return new UserIdentitiesRevokeAccessToDeviceResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesUpdateResponse.java b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesUpdateResponse.java new file mode 100644 index 0000000..5a8ffa1 --- /dev/null +++ b/src/main/java/com/seam/api/resources/useridentities/types/UserIdentitiesUpdateResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.useridentities.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentitiesUpdateResponse.Builder.class) +public final class UserIdentitiesUpdateResponse { + private final boolean ok; + + private final Map additionalProperties; + + private UserIdentitiesUpdateResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentitiesUpdateResponse && equalTo((UserIdentitiesUpdateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentitiesUpdateResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(UserIdentitiesUpdateResponse other); + } + + public interface _FinalStage { + UserIdentitiesUpdateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentitiesUpdateResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public UserIdentitiesUpdateResponse build() { + return new UserIdentitiesUpdateResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/webhooks/WebhooksClient.java b/src/main/java/com/seam/api/resources/webhooks/WebhooksClient.java index d01fd7c..a044b4a 100644 --- a/src/main/java/com/seam/api/resources/webhooks/WebhooksClient.java +++ b/src/main/java/com/seam/api/resources/webhooks/WebhooksClient.java @@ -3,24 +3,34 @@ */ package com.seam.api.resources.webhooks; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; import com.seam.api.resources.webhooks.requests.WebhooksCreateRequest; import com.seam.api.resources.webhooks.requests.WebhooksDeleteRequest; import com.seam.api.resources.webhooks.requests.WebhooksGetRequest; -import com.seam.api.types.WebhooksCreateResponse; -import com.seam.api.types.WebhooksDeleteResponse; -import com.seam.api.types.WebhooksGetResponse; -import com.seam.api.types.WebhooksListResponse; +import com.seam.api.resources.webhooks.requests.WebhooksUpdateRequest; +import com.seam.api.resources.webhooks.types.WebhooksCreateResponse; +import com.seam.api.resources.webhooks.types.WebhooksDeleteResponse; +import com.seam.api.resources.webhooks.types.WebhooksGetResponse; +import com.seam.api.resources.webhooks.types.WebhooksListResponse; +import com.seam.api.resources.webhooks.types.WebhooksUpdateResponse; +import com.seam.api.types.Webhook; import java.io.IOException; +import java.util.List; import okhttp3.Headers; import okhttp3.HttpUrl; -import okhttp3.MediaType; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class WebhooksClient { protected final ClientOptions clientOptions; @@ -29,7 +39,11 @@ public WebhooksClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public WebhooksCreateResponse create(WebhooksCreateRequest request, RequestOptions requestOptions) { + public Webhook create(WebhooksCreateRequest request) { + return create(request, null); + } + + public Webhook create(WebhooksCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("webhooks/create") @@ -37,9 +51,9 @@ public WebhooksCreateResponse create(WebhooksCreateRequest request, RequestOptio RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -47,22 +61,41 @@ public WebhooksCreateResponse create(WebhooksCreateRequest request, RequestOptio .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), WebhooksCreateResponse.class); + WebhooksCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhooksCreateResponse.class); + return parsedResponse.getWebhook(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public WebhooksCreateResponse create(WebhooksCreateRequest request) { - return create(request, null); + public WebhooksDeleteResponse delete(WebhooksDeleteRequest request) { + return delete(request, null); } public WebhooksDeleteResponse delete(WebhooksDeleteRequest request, RequestOptions requestOptions) { @@ -73,35 +106,52 @@ public WebhooksDeleteResponse delete(WebhooksDeleteRequest request, RequestOptio RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("DELETE", body) + .method("POST", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), WebhooksDeleteResponse.class); + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhooksDeleteResponse.class); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public WebhooksDeleteResponse delete(WebhooksDeleteRequest request) { - return delete(request, null); + public Webhook get(WebhooksGetRequest request) { + return get(request, null); } - public WebhooksGetResponse get(WebhooksGetRequest request, RequestOptions requestOptions) { + public Webhook get(WebhooksGetRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("webhooks/get") @@ -109,9 +159,9 @@ public WebhooksGetResponse get(WebhooksGetRequest request, RequestOptions reques RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaType.parse("application/json")); - } catch (Exception e) { - throw new RuntimeException(e); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -119,50 +169,137 @@ public WebhooksGetResponse get(WebhooksGetRequest request, RequestOptions reques .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), WebhooksGetResponse.class); + WebhooksGetResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhooksGetResponse.class); + return parsedResponse.getWebhook(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public WebhooksGetResponse get(WebhooksGetRequest request) { - return get(request, null); + public List list() { + return list(null); } - public WebhooksListResponse list(RequestOptions requestOptions) { + public List list(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("webhooks/list") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("GET", null) + .method("POST", RequestBody.create("", null)) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), WebhooksListResponse.class); + WebhooksListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhooksListResponse.class); + return parsedResponse.getWebhooks(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public WebhooksListResponse list() { - return list(null); + public WebhooksUpdateResponse update(WebhooksUpdateRequest request) { + return update(request, null); + } + + public WebhooksUpdateResponse update(WebhooksUpdateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("webhooks/update") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhooksUpdateResponse.class); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } } } diff --git a/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksCreateRequest.java b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksCreateRequest.java index 490833d..c839fd3 100644 --- a/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksCreateRequest.java +++ b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksCreateRequest.java @@ -44,7 +44,7 @@ public Optional> getEventTypes() { return eventTypes; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhooksCreateRequest && equalTo((WebhooksCreateRequest) other); @@ -59,12 +59,12 @@ private boolean equalTo(WebhooksCreateRequest other) { return url.equals(other.url) && eventTypes.equals(other.eventTypes); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.url, this.eventTypes); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,34 +98,34 @@ public static final class Builder implements UrlStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(WebhooksCreateRequest other) { url(other.getUrl()); eventTypes(other.getEventTypes()); return this; } - @Override + @java.lang.Override @JsonSetter("url") public _FinalStage url(String url) { this.url = url; return this; } - @Override + @java.lang.Override public _FinalStage eventTypes(List eventTypes) { this.eventTypes = Optional.of(eventTypes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "event_types", nulls = Nulls.SKIP) public _FinalStage eventTypes(Optional> eventTypes) { this.eventTypes = eventTypes; return this; } - @Override + @java.lang.Override public WebhooksCreateRequest build() { return new WebhooksCreateRequest(url, eventTypes, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksDeleteRequest.java b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksDeleteRequest.java index 3e4c8fe..41965de 100644 --- a/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksDeleteRequest.java +++ b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksDeleteRequest.java @@ -32,7 +32,7 @@ public String getWebhookId() { return webhookId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhooksDeleteRequest && equalTo((WebhooksDeleteRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(WebhooksDeleteRequest other) { return webhookId.equals(other.webhookId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.webhookId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements WebhookIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(WebhooksDeleteRequest other) { webhookId(other.getWebhookId()); return this; } - @Override + @java.lang.Override @JsonSetter("webhook_id") public _FinalStage webhookId(String webhookId) { this.webhookId = webhookId; return this; } - @Override + @java.lang.Override public WebhooksDeleteRequest build() { return new WebhooksDeleteRequest(webhookId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksGetRequest.java b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksGetRequest.java index a924674..bbb652b 100644 --- a/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksGetRequest.java +++ b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksGetRequest.java @@ -32,7 +32,7 @@ public String getWebhookId() { return webhookId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhooksGetRequest && equalTo((WebhooksGetRequest) other); @@ -47,12 +47,12 @@ private boolean equalTo(WebhooksGetRequest other) { return webhookId.equals(other.webhookId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.webhookId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements WebhookIdStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(WebhooksGetRequest other) { webhookId(other.getWebhookId()); return this; } - @Override + @java.lang.Override @JsonSetter("webhook_id") public _FinalStage webhookId(String webhookId) { this.webhookId = webhookId; return this; } - @Override + @java.lang.Override public WebhooksGetRequest build() { return new WebhooksGetRequest(webhookId, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksUpdateRequest.java b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksUpdateRequest.java new file mode 100644 index 0000000..2bf3fa7 --- /dev/null +++ b/src/main/java/com/seam/api/resources/webhooks/requests/WebhooksUpdateRequest.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.webhooks.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = WebhooksUpdateRequest.Builder.class) +public final class WebhooksUpdateRequest { + private final String webhookId; + + private final List eventTypes; + + private final Map additionalProperties; + + private WebhooksUpdateRequest(String webhookId, List eventTypes, Map additionalProperties) { + this.webhookId = webhookId; + this.eventTypes = eventTypes; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("webhook_id") + public String getWebhookId() { + return webhookId; + } + + @JsonProperty("event_types") + public List getEventTypes() { + return eventTypes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhooksUpdateRequest && equalTo((WebhooksUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhooksUpdateRequest other) { + return webhookId.equals(other.webhookId) && eventTypes.equals(other.eventTypes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.webhookId, this.eventTypes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static WebhookIdStage builder() { + return new Builder(); + } + + public interface WebhookIdStage { + _FinalStage webhookId(String webhookId); + + Builder from(WebhooksUpdateRequest other); + } + + public interface _FinalStage { + WebhooksUpdateRequest build(); + + _FinalStage eventTypes(List eventTypes); + + _FinalStage addEventTypes(String eventTypes); + + _FinalStage addAllEventTypes(List eventTypes); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements WebhookIdStage, _FinalStage { + private String webhookId; + + private List eventTypes = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhooksUpdateRequest other) { + webhookId(other.getWebhookId()); + eventTypes(other.getEventTypes()); + return this; + } + + @java.lang.Override + @JsonSetter("webhook_id") + public _FinalStage webhookId(String webhookId) { + this.webhookId = webhookId; + return this; + } + + @java.lang.Override + public _FinalStage addAllEventTypes(List eventTypes) { + this.eventTypes.addAll(eventTypes); + return this; + } + + @java.lang.Override + public _FinalStage addEventTypes(String eventTypes) { + this.eventTypes.add(eventTypes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "event_types", nulls = Nulls.SKIP) + public _FinalStage eventTypes(List eventTypes) { + this.eventTypes.clear(); + this.eventTypes.addAll(eventTypes); + return this; + } + + @java.lang.Override + public WebhooksUpdateRequest build() { + return new WebhooksUpdateRequest(webhookId, eventTypes, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/WebhooksCreateResponse.java b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksCreateResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/WebhooksCreateResponse.java rename to src/main/java/com/seam/api/resources/webhooks/types/WebhooksCreateResponse.java index de5d498..7f4e961 100644 --- a/src/main/java/com/seam/api/types/WebhooksCreateResponse.java +++ b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksCreateResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.webhooks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Webhook; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhooksCreateResponse && equalTo((WebhooksCreateResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(WebhooksCreateResponse other) { return webhook.equals(other.webhook) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.webhook, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements WebhookStage, OkStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(WebhooksCreateResponse other) { webhook(other.getWebhook()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("webhook") public OkStage webhook(Webhook webhook) { this.webhook = webhook; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public WebhooksCreateResponse build() { return new WebhooksCreateResponse(webhook, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/WebhooksDeleteResponse.java b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksDeleteResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/WebhooksDeleteResponse.java rename to src/main/java/com/seam/api/resources/webhooks/types/WebhooksDeleteResponse.java index 4f6d4bd..14df11e 100644 --- a/src/main/java/com/seam/api/types/WebhooksDeleteResponse.java +++ b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksDeleteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.webhooks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhooksDeleteResponse && equalTo((WebhooksDeleteResponse) other); @@ -47,12 +47,12 @@ private boolean equalTo(WebhooksDeleteResponse other) { return ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -80,20 +80,20 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(WebhooksDeleteResponse other) { ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public WebhooksDeleteResponse build() { return new WebhooksDeleteResponse(ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/WebhooksGetResponse.java b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksGetResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/WebhooksGetResponse.java rename to src/main/java/com/seam/api/resources/webhooks/types/WebhooksGetResponse.java index c07e8d9..89bb829 100644 --- a/src/main/java/com/seam/api/types/WebhooksGetResponse.java +++ b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.webhooks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Webhook; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -40,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhooksGetResponse && equalTo((WebhooksGetResponse) other); @@ -55,12 +56,12 @@ private boolean equalTo(WebhooksGetResponse other) { return webhook.equals(other.webhook) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.webhook, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +95,28 @@ public static final class Builder implements WebhookStage, OkStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(WebhooksGetResponse other) { webhook(other.getWebhook()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("webhook") public OkStage webhook(Webhook webhook) { this.webhook = webhook; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public WebhooksGetResponse build() { return new WebhooksGetResponse(webhook, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/WebhooksListResponse.java b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/WebhooksListResponse.java rename to src/main/java/com/seam/api/resources/webhooks/types/WebhooksListResponse.java index 2f80091..f66b02a 100644 --- a/src/main/java/com/seam/api/types/WebhooksListResponse.java +++ b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.webhooks.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Webhook; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -43,7 +44,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhooksListResponse && equalTo((WebhooksListResponse) other); @@ -58,12 +59,12 @@ private boolean equalTo(WebhooksListResponse other) { return webhooks.equals(other.webhooks) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.webhooks, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,33 +100,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(WebhooksListResponse other) { webhooks(other.getWebhooks()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllWebhooks(List webhooks) { this.webhooks.addAll(webhooks); return this; } - @Override + @java.lang.Override public _FinalStage addWebhooks(Webhook webhooks) { this.webhooks.add(webhooks); return this; } - @Override + @java.lang.Override @JsonSetter(value = "webhooks", nulls = Nulls.SKIP) public _FinalStage webhooks(List webhooks) { this.webhooks.clear(); @@ -133,7 +134,7 @@ public _FinalStage webhooks(List webhooks) { return this; } - @Override + @java.lang.Override public WebhooksListResponse build() { return new WebhooksListResponse(webhooks, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/resources/webhooks/types/WebhooksUpdateResponse.java b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksUpdateResponse.java new file mode 100644 index 0000000..c8ae8a4 --- /dev/null +++ b/src/main/java/com/seam/api/resources/webhooks/types/WebhooksUpdateResponse.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.webhooks.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = WebhooksUpdateResponse.Builder.class) +public final class WebhooksUpdateResponse { + private final boolean ok; + + private final Map additionalProperties; + + private WebhooksUpdateResponse(boolean ok, Map additionalProperties) { + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhooksUpdateResponse && equalTo((WebhooksUpdateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhooksUpdateResponse other) { + return ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OkStage builder() { + return new Builder(); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + + Builder from(WebhooksUpdateResponse other); + } + + public interface _FinalStage { + WebhooksUpdateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OkStage, _FinalStage { + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhooksUpdateResponse other) { + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public WebhooksUpdateResponse build() { + return new WebhooksUpdateResponse(ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/workspaces/WorkspacesClient.java b/src/main/java/com/seam/api/resources/workspaces/WorkspacesClient.java index 800f8f9..21aad6f 100644 --- a/src/main/java/com/seam/api/resources/workspaces/WorkspacesClient.java +++ b/src/main/java/com/seam/api/resources/workspaces/WorkspacesClient.java @@ -3,22 +3,31 @@ */ package com.seam.api.resources.workspaces; -import com.seam.api.core.ApiError; +import com.fasterxml.jackson.core.JsonProcessingException; import com.seam.api.core.ClientOptions; +import com.seam.api.core.MediaTypes; import com.seam.api.core.ObjectMappers; import com.seam.api.core.RequestOptions; +import com.seam.api.core.SeamApiApiError; +import com.seam.api.core.SeamApiError; +import com.seam.api.errors.SeamApiBadRequestError; +import com.seam.api.errors.SeamApiUnauthorizedError; +import com.seam.api.resources.workspaces.requests.WorkspacesCreateRequest; +import com.seam.api.resources.workspaces.types.WorkspacesCreateResponse; +import com.seam.api.resources.workspaces.types.WorkspacesGetResponse; +import com.seam.api.resources.workspaces.types.WorkspacesListResponse; +import com.seam.api.resources.workspaces.types.WorkspacesResetSandboxResponse; +import com.seam.api.types.ActionAttempt; import com.seam.api.types.Workspace; -import com.seam.api.types.WorkspacesGetResponse; -import com.seam.api.types.WorkspacesListResponse; -import com.seam.api.types.WorkspacesResetSandboxResponse; import java.io.IOException; import java.util.List; -import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; +import okhttp3.ResponseBody; public class WorkspacesClient { protected final ClientOptions clientOptions; @@ -27,34 +36,106 @@ public WorkspacesClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public Optional get() { + public Workspace create(WorkspacesCreateRequest request) { + return create(request, null); + } + + public Workspace create(WorkspacesCreateRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("workspaces/create") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new SeamApiError("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + WorkspacesCreateResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WorkspacesCreateResponse.class); + return parsedResponse.getWorkspace(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } catch (IOException e) { + throw new SeamApiError("Network error executing HTTP request", e); + } + } + + public Workspace get() { return get(null); } - public Optional get(RequestOptions requestOptions) { + public Workspace get(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("workspaces/get") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("GET", null) + .method("POST", RequestBody.create("", null)) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { WorkspacesGetResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), WorkspacesGetResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WorkspacesGetResponse.class); return parsedResponse.getWorkspace(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } @@ -69,31 +150,48 @@ public List list(RequestOptions requestOptions) { .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) - .method("GET", null) + .method("POST", RequestBody.create("", null)) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { WorkspacesListResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), WorkspacesListResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WorkspacesListResponse.class); return parsedResponse.getWorkspaces(); } - throw new ApiError( + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } - public WorkspacesResetSandboxResponse resetSandbox() { + public ActionAttempt resetSandbox() { return resetSandbox(null); } - public WorkspacesResetSandboxResponse resetSandbox(RequestOptions requestOptions) { + public ActionAttempt resetSandbox(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("workspaces/reset_sandbox") @@ -104,18 +202,36 @@ public WorkspacesResetSandboxResponse resetSandbox(RequestOptions requestOptions .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") .build(); - try { - Response response = - clientOptions.httpClient().newCall(okhttpRequest).execute(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue( - response.body().string(), WorkspacesResetSandboxResponse.class); + WorkspacesResetSandboxResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), WorkspacesResetSandboxResponse.class); + return parsedResponse.getActionAttempt(); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new SeamApiBadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + case 401: + throw new SeamApiUnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } - throw new ApiError( + throw new SeamApiApiError( + "Error with status code " + response.code(), response.code(), - ObjectMappers.JSON_MAPPER.readValue(response.body().string(), Object.class)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); } catch (IOException e) { - throw new RuntimeException(e); + throw new SeamApiError("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/seam/api/resources/workspaces/requests/WorkspacesCreateRequest.java b/src/main/java/com/seam/api/resources/workspaces/requests/WorkspacesCreateRequest.java new file mode 100644 index 0000000..2b988ea --- /dev/null +++ b/src/main/java/com/seam/api/resources/workspaces/requests/WorkspacesCreateRequest.java @@ -0,0 +1,269 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.workspaces.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.resources.workspaces.types.WebviewLogoShape; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = WorkspacesCreateRequest.Builder.class) +public final class WorkspacesCreateRequest { + private final String name; + + private final Optional companyName; + + private final Optional connectPartnerName; + + private final Optional isSandbox; + + private final Optional webviewPrimaryButtonColor; + + private final Optional webviewLogoShape; + + private final Map additionalProperties; + + private WorkspacesCreateRequest( + String name, + Optional companyName, + Optional connectPartnerName, + Optional isSandbox, + Optional webviewPrimaryButtonColor, + Optional webviewLogoShape, + Map additionalProperties) { + this.name = name; + this.companyName = companyName; + this.connectPartnerName = connectPartnerName; + this.isSandbox = isSandbox; + this.webviewPrimaryButtonColor = webviewPrimaryButtonColor; + this.webviewLogoShape = webviewLogoShape; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("company_name") + public Optional getCompanyName() { + return companyName; + } + + @JsonProperty("connect_partner_name") + public Optional getConnectPartnerName() { + return connectPartnerName; + } + + @JsonProperty("is_sandbox") + public Optional getIsSandbox() { + return isSandbox; + } + + @JsonProperty("webview_primary_button_color") + public Optional getWebviewPrimaryButtonColor() { + return webviewPrimaryButtonColor; + } + + @JsonProperty("webview_logo_shape") + public Optional getWebviewLogoShape() { + return webviewLogoShape; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WorkspacesCreateRequest && equalTo((WorkspacesCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WorkspacesCreateRequest other) { + return name.equals(other.name) + && companyName.equals(other.companyName) + && connectPartnerName.equals(other.connectPartnerName) + && isSandbox.equals(other.isSandbox) + && webviewPrimaryButtonColor.equals(other.webviewPrimaryButtonColor) + && webviewLogoShape.equals(other.webviewLogoShape); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.companyName, + this.connectPartnerName, + this.isSandbox, + this.webviewPrimaryButtonColor, + this.webviewLogoShape); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(String name); + + Builder from(WorkspacesCreateRequest other); + } + + public interface _FinalStage { + WorkspacesCreateRequest build(); + + _FinalStage companyName(Optional companyName); + + _FinalStage companyName(String companyName); + + _FinalStage connectPartnerName(Optional connectPartnerName); + + _FinalStage connectPartnerName(String connectPartnerName); + + _FinalStage isSandbox(Optional isSandbox); + + _FinalStage isSandbox(Boolean isSandbox); + + _FinalStage webviewPrimaryButtonColor(Optional webviewPrimaryButtonColor); + + _FinalStage webviewPrimaryButtonColor(String webviewPrimaryButtonColor); + + _FinalStage webviewLogoShape(Optional webviewLogoShape); + + _FinalStage webviewLogoShape(WebviewLogoShape webviewLogoShape); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional webviewLogoShape = Optional.empty(); + + private Optional webviewPrimaryButtonColor = Optional.empty(); + + private Optional isSandbox = Optional.empty(); + + private Optional connectPartnerName = Optional.empty(); + + private Optional companyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WorkspacesCreateRequest other) { + name(other.getName()); + companyName(other.getCompanyName()); + connectPartnerName(other.getConnectPartnerName()); + isSandbox(other.getIsSandbox()); + webviewPrimaryButtonColor(other.getWebviewPrimaryButtonColor()); + webviewLogoShape(other.getWebviewLogoShape()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(String name) { + this.name = name; + return this; + } + + @java.lang.Override + public _FinalStage webviewLogoShape(WebviewLogoShape webviewLogoShape) { + this.webviewLogoShape = Optional.of(webviewLogoShape); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webview_logo_shape", nulls = Nulls.SKIP) + public _FinalStage webviewLogoShape(Optional webviewLogoShape) { + this.webviewLogoShape = webviewLogoShape; + return this; + } + + @java.lang.Override + public _FinalStage webviewPrimaryButtonColor(String webviewPrimaryButtonColor) { + this.webviewPrimaryButtonColor = Optional.of(webviewPrimaryButtonColor); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webview_primary_button_color", nulls = Nulls.SKIP) + public _FinalStage webviewPrimaryButtonColor(Optional webviewPrimaryButtonColor) { + this.webviewPrimaryButtonColor = webviewPrimaryButtonColor; + return this; + } + + @java.lang.Override + public _FinalStage isSandbox(Boolean isSandbox) { + this.isSandbox = Optional.of(isSandbox); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_sandbox", nulls = Nulls.SKIP) + public _FinalStage isSandbox(Optional isSandbox) { + this.isSandbox = isSandbox; + return this; + } + + @java.lang.Override + public _FinalStage connectPartnerName(String connectPartnerName) { + this.connectPartnerName = Optional.of(connectPartnerName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "connect_partner_name", nulls = Nulls.SKIP) + public _FinalStage connectPartnerName(Optional connectPartnerName) { + this.connectPartnerName = connectPartnerName; + return this; + } + + @java.lang.Override + public _FinalStage companyName(String companyName) { + this.companyName = Optional.of(companyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company_name", nulls = Nulls.SKIP) + public _FinalStage companyName(Optional companyName) { + this.companyName = companyName; + return this; + } + + @java.lang.Override + public WorkspacesCreateRequest build() { + return new WorkspacesCreateRequest( + name, + companyName, + connectPartnerName, + isSandbox, + webviewPrimaryButtonColor, + webviewLogoShape, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/resources/workspaces/types/WebviewLogoShape.java b/src/main/java/com/seam/api/resources/workspaces/types/WebviewLogoShape.java new file mode 100644 index 0000000..ef04331 --- /dev/null +++ b/src/main/java/com/seam/api/resources/workspaces/types/WebviewLogoShape.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.workspaces.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum WebviewLogoShape { + CIRCLE("circle"), + + SQUARE("square"); + + private final String value; + + WebviewLogoShape(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesCreateResponse.java b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesCreateResponse.java new file mode 100644 index 0000000..799fe72 --- /dev/null +++ b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesCreateResponse.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.resources.workspaces.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Workspace; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = WorkspacesCreateResponse.Builder.class) +public final class WorkspacesCreateResponse { + private final Workspace workspace; + + private final boolean ok; + + private final Map additionalProperties; + + private WorkspacesCreateResponse(Workspace workspace, boolean ok, Map additionalProperties) { + this.workspace = workspace; + this.ok = ok; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("workspace") + public Workspace getWorkspace() { + return workspace; + } + + @JsonProperty("ok") + public boolean getOk() { + return ok; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WorkspacesCreateResponse && equalTo((WorkspacesCreateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WorkspacesCreateResponse other) { + return workspace.equals(other.workspace) && ok == other.ok; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.workspace, this.ok); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static WorkspaceStage builder() { + return new Builder(); + } + + public interface WorkspaceStage { + OkStage workspace(Workspace workspace); + + Builder from(WorkspacesCreateResponse other); + } + + public interface OkStage { + _FinalStage ok(boolean ok); + } + + public interface _FinalStage { + WorkspacesCreateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements WorkspaceStage, OkStage, _FinalStage { + private Workspace workspace; + + private boolean ok; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WorkspacesCreateResponse other) { + workspace(other.getWorkspace()); + ok(other.getOk()); + return this; + } + + @java.lang.Override + @JsonSetter("workspace") + public OkStage workspace(Workspace workspace) { + this.workspace = workspace; + return this; + } + + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; + return this; + } + + @java.lang.Override + public WorkspacesCreateResponse build() { + return new WorkspacesCreateResponse(workspace, ok, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/WorkspacesGetResponse.java b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesGetResponse.java similarity index 72% rename from src/main/java/com/seam/api/types/WorkspacesGetResponse.java rename to src/main/java/com/seam/api/resources/workspaces/types/WorkspacesGetResponse.java index a13defd..7ea080b 100644 --- a/src/main/java/com/seam/api/types/WorkspacesGetResponse.java +++ b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesGetResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.workspaces.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -9,31 +9,30 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Workspace; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = WorkspacesGetResponse.Builder.class) public final class WorkspacesGetResponse { - private final Optional workspace; + private final Workspace workspace; private final boolean ok; private final Map additionalProperties; - private WorkspacesGetResponse(Optional workspace, boolean ok, Map additionalProperties) { + private WorkspacesGetResponse(Workspace workspace, boolean ok, Map additionalProperties) { this.workspace = workspace; this.ok = ok; this.additionalProperties = additionalProperties; } @JsonProperty("workspace") - public Optional getWorkspace() { + public Workspace getWorkspace() { return workspace; } @@ -42,7 +41,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WorkspacesGetResponse && equalTo((WorkspacesGetResponse) other); @@ -57,73 +56,67 @@ private boolean equalTo(WorkspacesGetResponse other) { return workspace.equals(other.workspace) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.workspace, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } - public static OkStage builder() { + public static WorkspaceStage builder() { return new Builder(); } - public interface OkStage { - _FinalStage ok(boolean ok); + public interface WorkspaceStage { + OkStage workspace(Workspace workspace); Builder from(WorkspacesGetResponse other); } + public interface OkStage { + _FinalStage ok(boolean ok); + } + public interface _FinalStage { WorkspacesGetResponse build(); - - _FinalStage workspace(Optional workspace); - - _FinalStage workspace(Workspace workspace); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements OkStage, _FinalStage { - private boolean ok; + public static final class Builder implements WorkspaceStage, OkStage, _FinalStage { + private Workspace workspace; - private Optional workspace = Optional.empty(); + private boolean ok; @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(WorkspacesGetResponse other) { workspace(other.getWorkspace()); ok(other.getOk()); return this; } - @Override - @JsonSetter("ok") - public _FinalStage ok(boolean ok) { - this.ok = ok; - return this; - } - - @Override - public _FinalStage workspace(Workspace workspace) { - this.workspace = Optional.of(workspace); + @java.lang.Override + @JsonSetter("workspace") + public OkStage workspace(Workspace workspace) { + this.workspace = workspace; return this; } - @Override - @JsonSetter(value = "workspace", nulls = Nulls.SKIP) - public _FinalStage workspace(Optional workspace) { - this.workspace = workspace; + @java.lang.Override + @JsonSetter("ok") + public _FinalStage ok(boolean ok) { + this.ok = ok; return this; } - @Override + @java.lang.Override public WorkspacesGetResponse build() { return new WorkspacesGetResponse(workspace, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/WorkspacesListResponse.java b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesListResponse.java similarity index 92% rename from src/main/java/com/seam/api/types/WorkspacesListResponse.java rename to src/main/java/com/seam/api/resources/workspaces/types/WorkspacesListResponse.java index f4ba33d..da4c8a3 100644 --- a/src/main/java/com/seam/api/types/WorkspacesListResponse.java +++ b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesListResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.workspaces.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.Workspace; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -43,7 +44,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WorkspacesListResponse && equalTo((WorkspacesListResponse) other); @@ -58,12 +59,12 @@ private boolean equalTo(WorkspacesListResponse other) { return workspaces.equals(other.workspaces) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.workspaces, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -99,33 +100,33 @@ public static final class Builder implements OkStage, _FinalStage { private Builder() {} - @Override + @java.lang.Override public Builder from(WorkspacesListResponse other) { workspaces(other.getWorkspaces()); ok(other.getOk()); return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public _FinalStage addAllWorkspaces(List workspaces) { this.workspaces.addAll(workspaces); return this; } - @Override + @java.lang.Override public _FinalStage addWorkspaces(Workspace workspaces) { this.workspaces.add(workspaces); return this; } - @Override + @java.lang.Override @JsonSetter(value = "workspaces", nulls = Nulls.SKIP) public _FinalStage workspaces(List workspaces) { this.workspaces.clear(); @@ -133,7 +134,7 @@ public _FinalStage workspaces(List workspaces) { return this; } - @Override + @java.lang.Override public WorkspacesListResponse build() { return new WorkspacesListResponse(workspaces, ok, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/WorkspacesResetSandboxResponse.java b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesResetSandboxResponse.java similarity index 64% rename from src/main/java/com/seam/api/types/WorkspacesResetSandboxResponse.java rename to src/main/java/com/seam/api/resources/workspaces/types/WorkspacesResetSandboxResponse.java index 18d01a0..12208a7 100644 --- a/src/main/java/com/seam/api/types/WorkspacesResetSandboxResponse.java +++ b/src/main/java/com/seam/api/resources/workspaces/types/WorkspacesResetSandboxResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.seam.api.types; +package com.seam.api.resources.workspaces.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; +import com.seam.api.types.ActionAttempt; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -18,21 +19,22 @@ @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = WorkspacesResetSandboxResponse.Builder.class) public final class WorkspacesResetSandboxResponse { - private final String message; + private final ActionAttempt actionAttempt; private final boolean ok; private final Map additionalProperties; - private WorkspacesResetSandboxResponse(String message, boolean ok, Map additionalProperties) { - this.message = message; + private WorkspacesResetSandboxResponse( + ActionAttempt actionAttempt, boolean ok, Map additionalProperties) { + this.actionAttempt = actionAttempt; this.ok = ok; this.additionalProperties = additionalProperties; } - @JsonProperty("message") - public String getMessage() { - return message; + @JsonProperty("action_attempt") + public ActionAttempt getActionAttempt() { + return actionAttempt; } @JsonProperty("ok") @@ -40,7 +42,7 @@ public boolean getOk() { return ok; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WorkspacesResetSandboxResponse && equalTo((WorkspacesResetSandboxResponse) other); @@ -52,25 +54,25 @@ public Map getAdditionalProperties() { } private boolean equalTo(WorkspacesResetSandboxResponse other) { - return message.equals(other.message) && ok == other.ok; + return actionAttempt.equals(other.actionAttempt) && ok == other.ok; } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.message, this.ok); + return Objects.hash(this.actionAttempt, this.ok); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } - public static MessageStage builder() { + public static ActionAttemptStage builder() { return new Builder(); } - public interface MessageStage { - OkStage message(String message); + public interface ActionAttemptStage { + OkStage actionAttempt(ActionAttempt actionAttempt); Builder from(WorkspacesResetSandboxResponse other); } @@ -84,8 +86,8 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MessageStage, OkStage, _FinalStage { - private String message; + public static final class Builder implements ActionAttemptStage, OkStage, _FinalStage { + private ActionAttempt actionAttempt; private boolean ok; @@ -94,30 +96,30 @@ public static final class Builder implements MessageStage, OkStage, _FinalStage private Builder() {} - @Override + @java.lang.Override public Builder from(WorkspacesResetSandboxResponse other) { - message(other.getMessage()); + actionAttempt(other.getActionAttempt()); ok(other.getOk()); return this; } - @Override - @JsonSetter("message") - public OkStage message(String message) { - this.message = message; + @java.lang.Override + @JsonSetter("action_attempt") + public OkStage actionAttempt(ActionAttempt actionAttempt) { + this.actionAttempt = actionAttempt; return this; } - @Override + @java.lang.Override @JsonSetter("ok") public _FinalStage ok(boolean ok) { this.ok = ok; return this; } - @Override + @java.lang.Override public WorkspacesResetSandboxResponse build() { - return new WorkspacesResetSandboxResponse(message, ok, additionalProperties); + return new WorkspacesResetSandboxResponse(actionAttempt, ok, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/AccessCode.java b/src/main/java/com/seam/api/types/AccessCode.java index 2053cad..1127974 100644 --- a/src/main/java/com/seam/api/types/AccessCode.java +++ b/src/main/java/com/seam/api/types/AccessCode.java @@ -57,6 +57,12 @@ public final class AccessCode { private final Optional pulledBackupAccessCodeId; + private final boolean isExternalModificationAllowed; + + private final boolean isOneTimeUse; + + private final boolean isOfflineAccessCode; + private final Map additionalProperties; private AccessCode( @@ -78,6 +84,9 @@ private AccessCode( boolean isBackupAccessCodeAvailable, Optional isBackup, Optional pulledBackupAccessCodeId, + boolean isExternalModificationAllowed, + boolean isOneTimeUse, + boolean isOfflineAccessCode, Map additionalProperties) { this.commonCodeKey = commonCodeKey; this.isScheduledOnDevice = isScheduledOnDevice; @@ -97,49 +106,79 @@ private AccessCode( this.isBackupAccessCodeAvailable = isBackupAccessCodeAvailable; this.isBackup = isBackup; this.pulledBackupAccessCodeId = pulledBackupAccessCodeId; + this.isExternalModificationAllowed = isExternalModificationAllowed; + this.isOneTimeUse = isOneTimeUse; + this.isOfflineAccessCode = isOfflineAccessCode; this.additionalProperties = additionalProperties; } + /** + * @return Unique identifier for a group of access codes that share the same code. + */ @JsonProperty("common_code_key") public Optional getCommonCodeKey() { return commonCodeKey; } + /** + * @return Indicates whether the code is set on the device according to a preconfigured schedule. + */ @JsonProperty("is_scheduled_on_device") public Optional getIsScheduledOnDevice() { return isScheduledOnDevice; } + /** + * @return Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration. + */ @JsonProperty("type") public AccessCodeType getType() { return type; } + /** + * @return Indicates whether the access code is waiting for a code assignment. + */ @JsonProperty("is_waiting_for_code_assignment") public Optional getIsWaitingForCodeAssignment() { return isWaitingForCodeAssignment; } + /** + * @return Unique identifier for the access code. + */ @JsonProperty("access_code_id") public String getAccessCodeId() { return accessCodeId; } + /** + * @return Unique identifier for the device associated with the access code. + */ @JsonProperty("device_id") public String getDeviceId() { return deviceId; } + /** + * @return Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + */ @JsonProperty("name") public Optional getName() { return name; } + /** + * @return Code used for access. Typically, a numeric or alphanumeric string. + */ @JsonProperty("code") public Optional getCode() { return code; } + /** + * @return Date and time at which the access code was created. + */ @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; @@ -155,42 +194,87 @@ public Optional getWarnings() { return warnings; } + /** + * @return Indicates whether Seam manages the access code. + */ @JsonProperty("is_managed") public boolean getIsManaged() { return isManaged; } + /** + * @return Date and time at which the time-bound access code becomes active. + */ @JsonProperty("starts_at") public Optional getStartsAt() { return startsAt; } + /** + * @return Date and time after which the time-bound access code becomes inactive. + */ @JsonProperty("ends_at") public Optional getEndsAt() { return endsAt; } + /** + * @return Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. + */ @JsonProperty("status") public AccessCodeStatus getStatus() { return status; } + /** + * @return Indicates whether a backup access code is available for use if the primary access code is lost or compromised. + */ @JsonProperty("is_backup_access_code_available") public boolean getIsBackupAccessCodeAvailable() { return isBackupAccessCodeAvailable; } + /** + * @return Indicates whether the access code is a backup code. + */ @JsonProperty("is_backup") public Optional getIsBackup() { return isBackup; } + /** + * @return Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code. + */ @JsonProperty("pulled_backup_access_code_id") public Optional getPulledBackupAccessCodeId() { return pulledBackupAccessCodeId; } - @Override + /** + * @return Indicates whether changes to the access code from external sources are permitted. + */ + @JsonProperty("is_external_modification_allowed") + public boolean getIsExternalModificationAllowed() { + return isExternalModificationAllowed; + } + + /** + * @return Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use. + */ + @JsonProperty("is_one_time_use") + public boolean getIsOneTimeUse() { + return isOneTimeUse; + } + + /** + * @return Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection. + */ + @JsonProperty("is_offline_access_code") + public boolean getIsOfflineAccessCode() { + return isOfflineAccessCode; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof AccessCode && equalTo((AccessCode) other); @@ -219,10 +303,13 @@ private boolean equalTo(AccessCode other) { && status.equals(other.status) && isBackupAccessCodeAvailable == other.isBackupAccessCodeAvailable && isBackup.equals(other.isBackup) - && pulledBackupAccessCodeId.equals(other.pulledBackupAccessCodeId); + && pulledBackupAccessCodeId.equals(other.pulledBackupAccessCodeId) + && isExternalModificationAllowed == other.isExternalModificationAllowed + && isOneTimeUse == other.isOneTimeUse + && isOfflineAccessCode == other.isOfflineAccessCode; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.commonCodeKey, @@ -242,10 +329,13 @@ public int hashCode() { this.status, this.isBackupAccessCodeAvailable, this.isBackup, - this.pulledBackupAccessCodeId); + this.pulledBackupAccessCodeId, + this.isExternalModificationAllowed, + this.isOneTimeUse, + this.isOfflineAccessCode); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -281,7 +371,19 @@ public interface StatusStage { } public interface IsBackupAccessCodeAvailableStage { - _FinalStage isBackupAccessCodeAvailable(boolean isBackupAccessCodeAvailable); + IsExternalModificationAllowedStage isBackupAccessCodeAvailable(boolean isBackupAccessCodeAvailable); + } + + public interface IsExternalModificationAllowedStage { + IsOneTimeUseStage isExternalModificationAllowed(boolean isExternalModificationAllowed); + } + + public interface IsOneTimeUseStage { + IsOfflineAccessCodeStage isOneTimeUse(boolean isOneTimeUse); + } + + public interface IsOfflineAccessCodeStage { + _FinalStage isOfflineAccessCode(boolean isOfflineAccessCode); } public interface _FinalStage { @@ -341,6 +443,9 @@ public static final class Builder IsManagedStage, StatusStage, IsBackupAccessCodeAvailableStage, + IsExternalModificationAllowedStage, + IsOneTimeUseStage, + IsOfflineAccessCodeStage, _FinalStage { private AccessCodeType type; @@ -356,6 +461,12 @@ public static final class Builder private boolean isBackupAccessCodeAvailable; + private boolean isExternalModificationAllowed; + + private boolean isOneTimeUse; + + private boolean isOfflineAccessCode; + private Optional pulledBackupAccessCodeId = Optional.empty(); private Optional isBackup = Optional.empty(); @@ -383,7 +494,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(AccessCode other) { commonCodeKey(other.getCommonCodeKey()); isScheduledOnDevice(other.getIsScheduledOnDevice()); @@ -403,202 +514,302 @@ public Builder from(AccessCode other) { isBackupAccessCodeAvailable(other.getIsBackupAccessCodeAvailable()); isBackup(other.getIsBackup()); pulledBackupAccessCodeId(other.getPulledBackupAccessCodeId()); + isExternalModificationAllowed(other.getIsExternalModificationAllowed()); + isOneTimeUse(other.getIsOneTimeUse()); + isOfflineAccessCode(other.getIsOfflineAccessCode()); return this; } - @Override + /** + *

Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("type") public AccessCodeIdStage type(AccessCodeType type) { this.type = type; return this; } - @Override + /** + *

Unique identifier for the access code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("access_code_id") public DeviceIdStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + /** + *

Unique identifier for the device associated with the access code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("device_id") public CreatedAtStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + /** + *

Date and time at which the access code was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("created_at") public IsManagedStage createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Override + /** + *

Indicates whether Seam manages the access code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("is_managed") public StatusStage isManaged(boolean isManaged) { this.isManaged = isManaged; return this; } - @Override + /** + *

Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("status") public IsBackupAccessCodeAvailableStage status(AccessCodeStatus status) { this.status = status; return this; } - @Override + /** + *

Indicates whether a backup access code is available for use if the primary access code is lost or compromised.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("is_backup_access_code_available") - public _FinalStage isBackupAccessCodeAvailable(boolean isBackupAccessCodeAvailable) { + public IsExternalModificationAllowedStage isBackupAccessCodeAvailable(boolean isBackupAccessCodeAvailable) { this.isBackupAccessCodeAvailable = isBackupAccessCodeAvailable; return this; } - @Override + /** + *

Indicates whether changes to the access code from external sources are permitted.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_external_modification_allowed") + public IsOneTimeUseStage isExternalModificationAllowed(boolean isExternalModificationAllowed) { + this.isExternalModificationAllowed = isExternalModificationAllowed; + return this; + } + + /** + *

Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_one_time_use") + public IsOfflineAccessCodeStage isOneTimeUse(boolean isOneTimeUse) { + this.isOneTimeUse = isOneTimeUse; + return this; + } + + /** + *

Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_offline_access_code") + public _FinalStage isOfflineAccessCode(boolean isOfflineAccessCode) { + this.isOfflineAccessCode = isOfflineAccessCode; + return this; + } + + /** + *

Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage pulledBackupAccessCodeId(String pulledBackupAccessCodeId) { this.pulledBackupAccessCodeId = Optional.of(pulledBackupAccessCodeId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "pulled_backup_access_code_id", nulls = Nulls.SKIP) public _FinalStage pulledBackupAccessCodeId(Optional pulledBackupAccessCodeId) { this.pulledBackupAccessCodeId = pulledBackupAccessCodeId; return this; } - @Override + /** + *

Indicates whether the access code is a backup code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage isBackup(Boolean isBackup) { this.isBackup = Optional.of(isBackup); return this; } - @Override + @java.lang.Override @JsonSetter(value = "is_backup", nulls = Nulls.SKIP) public _FinalStage isBackup(Optional isBackup) { this.isBackup = isBackup; return this; } - @Override + /** + *

Date and time after which the time-bound access code becomes inactive.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage endsAt(OffsetDateTime endsAt) { this.endsAt = Optional.of(endsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) public _FinalStage endsAt(Optional endsAt) { this.endsAt = endsAt; return this; } - @Override + /** + *

Date and time at which the time-bound access code becomes active.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage startsAt(OffsetDateTime startsAt) { this.startsAt = Optional.of(startsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) public _FinalStage startsAt(Optional startsAt) { this.startsAt = startsAt; return this; } - @Override + @java.lang.Override public _FinalStage warnings(Object warnings) { this.warnings = Optional.of(warnings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "warnings", nulls = Nulls.SKIP) public _FinalStage warnings(Optional warnings) { this.warnings = warnings; return this; } - @Override + @java.lang.Override public _FinalStage errors(Object errors) { this.errors = Optional.of(errors); return this; } - @Override + @java.lang.Override @JsonSetter(value = "errors", nulls = Nulls.SKIP) public _FinalStage errors(Optional errors) { this.errors = errors; return this; } - @Override + /** + *

Code used for access. Typically, a numeric or alphanumeric string.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage code(String code) { this.code = Optional.of(code); return this; } - @Override + @java.lang.Override @JsonSetter(value = "code", nulls = Nulls.SKIP) public _FinalStage code(Optional code) { this.code = code; return this; } - @Override + /** + *

Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + /** + *

Indicates whether the access code is waiting for a code assignment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage isWaitingForCodeAssignment(Boolean isWaitingForCodeAssignment) { this.isWaitingForCodeAssignment = Optional.of(isWaitingForCodeAssignment); return this; } - @Override + @java.lang.Override @JsonSetter(value = "is_waiting_for_code_assignment", nulls = Nulls.SKIP) public _FinalStage isWaitingForCodeAssignment(Optional isWaitingForCodeAssignment) { this.isWaitingForCodeAssignment = isWaitingForCodeAssignment; return this; } - @Override + /** + *

Indicates whether the code is set on the device according to a preconfigured schedule.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage isScheduledOnDevice(Boolean isScheduledOnDevice) { this.isScheduledOnDevice = Optional.of(isScheduledOnDevice); return this; } - @Override + @java.lang.Override @JsonSetter(value = "is_scheduled_on_device", nulls = Nulls.SKIP) public _FinalStage isScheduledOnDevice(Optional isScheduledOnDevice) { this.isScheduledOnDevice = isScheduledOnDevice; return this; } - @Override + /** + *

Unique identifier for a group of access codes that share the same code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage commonCodeKey(String commonCodeKey) { this.commonCodeKey = Optional.of(commonCodeKey); return this; } - @Override + @java.lang.Override @JsonSetter(value = "common_code_key", nulls = Nulls.SKIP) public _FinalStage commonCodeKey(Optional commonCodeKey) { this.commonCodeKey = commonCodeKey; return this; } - @Override + @java.lang.Override public AccessCode build() { return new AccessCode( commonCodeKey, @@ -619,6 +830,9 @@ public AccessCode build() { isBackupAccessCodeAvailable, isBackup, pulledBackupAccessCodeId, + isExternalModificationAllowed, + isOneTimeUse, + isOfflineAccessCode, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/AccessCodeStatus.java b/src/main/java/com/seam/api/types/AccessCodeStatus.java index 220b7b9..315a997 100644 --- a/src/main/java/com/seam/api/types/AccessCodeStatus.java +++ b/src/main/java/com/seam/api/types/AccessCodeStatus.java @@ -23,7 +23,7 @@ public enum AccessCodeStatus { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/AccessCodeType.java b/src/main/java/com/seam/api/types/AccessCodeType.java index b968148..0f3e75e 100644 --- a/src/main/java/com/seam/api/types/AccessCodeType.java +++ b/src/main/java/com/seam/api/types/AccessCodeType.java @@ -17,7 +17,7 @@ public enum AccessCodeType { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/AcsAccessGroup.java b/src/main/java/com/seam/api/types/AcsAccessGroup.java new file mode 100644 index 0000000..4e3eda1 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsAccessGroup.java @@ -0,0 +1,352 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsAccessGroup.Builder.class) +public final class AcsAccessGroup { + private final String acsAccessGroupId; + + private final String acsSystemId; + + private final String workspaceId; + + private final String name; + + private final AcsAccessGroupAccessGroupType accessGroupType; + + private final String accessGroupTypeDisplayName; + + private final String displayName; + + private final AcsAccessGroupExternalType externalType; + + private final String externalTypeDisplayName; + + private final OffsetDateTime createdAt; + + private final Map additionalProperties; + + private AcsAccessGroup( + String acsAccessGroupId, + String acsSystemId, + String workspaceId, + String name, + AcsAccessGroupAccessGroupType accessGroupType, + String accessGroupTypeDisplayName, + String displayName, + AcsAccessGroupExternalType externalType, + String externalTypeDisplayName, + OffsetDateTime createdAt, + Map additionalProperties) { + this.acsAccessGroupId = acsAccessGroupId; + this.acsSystemId = acsSystemId; + this.workspaceId = workspaceId; + this.name = name; + this.accessGroupType = accessGroupType; + this.accessGroupTypeDisplayName = accessGroupTypeDisplayName; + this.displayName = displayName; + this.externalType = externalType; + this.externalTypeDisplayName = externalTypeDisplayName; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_access_group_id") + public String getAcsAccessGroupId() { + return acsAccessGroupId; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("access_group_type") + public AcsAccessGroupAccessGroupType getAccessGroupType() { + return accessGroupType; + } + + @JsonProperty("access_group_type_display_name") + public String getAccessGroupTypeDisplayName() { + return accessGroupTypeDisplayName; + } + + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("external_type") + public AcsAccessGroupExternalType getExternalType() { + return externalType; + } + + @JsonProperty("external_type_display_name") + public String getExternalTypeDisplayName() { + return externalTypeDisplayName; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsAccessGroup && equalTo((AcsAccessGroup) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsAccessGroup other) { + return acsAccessGroupId.equals(other.acsAccessGroupId) + && acsSystemId.equals(other.acsSystemId) + && workspaceId.equals(other.workspaceId) + && name.equals(other.name) + && accessGroupType.equals(other.accessGroupType) + && accessGroupTypeDisplayName.equals(other.accessGroupTypeDisplayName) + && displayName.equals(other.displayName) + && externalType.equals(other.externalType) + && externalTypeDisplayName.equals(other.externalTypeDisplayName) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsAccessGroupId, + this.acsSystemId, + this.workspaceId, + this.name, + this.accessGroupType, + this.accessGroupTypeDisplayName, + this.displayName, + this.externalType, + this.externalTypeDisplayName, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsAccessGroupIdStage builder() { + return new Builder(); + } + + public interface AcsAccessGroupIdStage { + AcsSystemIdStage acsAccessGroupId(String acsAccessGroupId); + + Builder from(AcsAccessGroup other); + } + + public interface AcsSystemIdStage { + WorkspaceIdStage acsSystemId(String acsSystemId); + } + + public interface WorkspaceIdStage { + NameStage workspaceId(String workspaceId); + } + + public interface NameStage { + AccessGroupTypeStage name(String name); + } + + public interface AccessGroupTypeStage { + AccessGroupTypeDisplayNameStage accessGroupType(AcsAccessGroupAccessGroupType accessGroupType); + } + + public interface AccessGroupTypeDisplayNameStage { + DisplayNameStage accessGroupTypeDisplayName(String accessGroupTypeDisplayName); + } + + public interface DisplayNameStage { + ExternalTypeStage displayName(String displayName); + } + + public interface ExternalTypeStage { + ExternalTypeDisplayNameStage externalType(AcsAccessGroupExternalType externalType); + } + + public interface ExternalTypeDisplayNameStage { + CreatedAtStage externalTypeDisplayName(String externalTypeDisplayName); + } + + public interface CreatedAtStage { + _FinalStage createdAt(OffsetDateTime createdAt); + } + + public interface _FinalStage { + AcsAccessGroup build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsAccessGroupIdStage, + AcsSystemIdStage, + WorkspaceIdStage, + NameStage, + AccessGroupTypeStage, + AccessGroupTypeDisplayNameStage, + DisplayNameStage, + ExternalTypeStage, + ExternalTypeDisplayNameStage, + CreatedAtStage, + _FinalStage { + private String acsAccessGroupId; + + private String acsSystemId; + + private String workspaceId; + + private String name; + + private AcsAccessGroupAccessGroupType accessGroupType; + + private String accessGroupTypeDisplayName; + + private String displayName; + + private AcsAccessGroupExternalType externalType; + + private String externalTypeDisplayName; + + private OffsetDateTime createdAt; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsAccessGroup other) { + acsAccessGroupId(other.getAcsAccessGroupId()); + acsSystemId(other.getAcsSystemId()); + workspaceId(other.getWorkspaceId()); + name(other.getName()); + accessGroupType(other.getAccessGroupType()); + accessGroupTypeDisplayName(other.getAccessGroupTypeDisplayName()); + displayName(other.getDisplayName()); + externalType(other.getExternalType()); + externalTypeDisplayName(other.getExternalTypeDisplayName()); + createdAt(other.getCreatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_access_group_id") + public AcsSystemIdStage acsAccessGroupId(String acsAccessGroupId) { + this.acsAccessGroupId = acsAccessGroupId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public WorkspaceIdStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public NameStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + @JsonSetter("name") + public AccessGroupTypeStage name(String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("access_group_type") + public AccessGroupTypeDisplayNameStage accessGroupType(AcsAccessGroupAccessGroupType accessGroupType) { + this.accessGroupType = accessGroupType; + return this; + } + + @java.lang.Override + @JsonSetter("access_group_type_display_name") + public DisplayNameStage accessGroupTypeDisplayName(String accessGroupTypeDisplayName) { + this.accessGroupTypeDisplayName = accessGroupTypeDisplayName; + return this; + } + + @java.lang.Override + @JsonSetter("display_name") + public ExternalTypeStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + @JsonSetter("external_type") + public ExternalTypeDisplayNameStage externalType(AcsAccessGroupExternalType externalType) { + this.externalType = externalType; + return this; + } + + @java.lang.Override + @JsonSetter("external_type_display_name") + public CreatedAtStage externalTypeDisplayName(String externalTypeDisplayName) { + this.externalTypeDisplayName = externalTypeDisplayName; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public AcsAccessGroup build() { + return new AcsAccessGroup( + acsAccessGroupId, + acsSystemId, + workspaceId, + name, + accessGroupType, + accessGroupTypeDisplayName, + displayName, + externalType, + externalTypeDisplayName, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsAccessGroupAccessGroupType.java b/src/main/java/com/seam/api/types/AcsAccessGroupAccessGroupType.java new file mode 100644 index 0000000..c3ff5a1 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsAccessGroupAccessGroupType.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsAccessGroupAccessGroupType { + PTI_UNIT("pti_unit"), + + PTI_ACCESS_LEVEL("pti_access_level"), + + SALTO_ACCESS_GROUP("salto_access_group"), + + BRIVO_GROUP("brivo_group"); + + private final String value; + + AcsAccessGroupAccessGroupType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/AcsAccessGroupExternalType.java b/src/main/java/com/seam/api/types/AcsAccessGroupExternalType.java new file mode 100644 index 0000000..f095d89 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsAccessGroupExternalType.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsAccessGroupExternalType { + PTI_UNIT("pti_unit"), + + PTI_ACCESS_LEVEL("pti_access_level"), + + SALTO_ACCESS_GROUP("salto_access_group"), + + BRIVO_GROUP("brivo_group"); + + private final String value; + + AcsAccessGroupExternalType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/AcsCredential.java b/src/main/java/com/seam/api/types/AcsCredential.java new file mode 100644 index 0000000..dc9229d --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsCredential.java @@ -0,0 +1,718 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsCredential.Builder.class) +public final class AcsCredential { + private final String acsCredentialId; + + private final Optional acsUserId; + + private final Optional acsCredentialPoolId; + + private final String acsSystemId; + + private final Optional parentAcsCredentialId; + + private final String displayName; + + private final Optional code; + + private final AcsCredentialAccessMethod accessMethod; + + private final Optional externalType; + + private final Optional externalTypeDisplayName; + + private final OffsetDateTime createdAt; + + private final String workspaceId; + + private final Optional startsAt; + + private final Optional endsAt; + + private final List errors; + + private final List warnings; + + private final Optional isMultiPhoneSyncCredential; + + private final Optional isLatestDesiredStateSyncedWithProvider; + + private final Optional latestDesiredStateSyncedWithProviderAt; + + private final Optional visionlineMetadata; + + private final Map additionalProperties; + + private AcsCredential( + String acsCredentialId, + Optional acsUserId, + Optional acsCredentialPoolId, + String acsSystemId, + Optional parentAcsCredentialId, + String displayName, + Optional code, + AcsCredentialAccessMethod accessMethod, + Optional externalType, + Optional externalTypeDisplayName, + OffsetDateTime createdAt, + String workspaceId, + Optional startsAt, + Optional endsAt, + List errors, + List warnings, + Optional isMultiPhoneSyncCredential, + Optional isLatestDesiredStateSyncedWithProvider, + Optional latestDesiredStateSyncedWithProviderAt, + Optional visionlineMetadata, + Map additionalProperties) { + this.acsCredentialId = acsCredentialId; + this.acsUserId = acsUserId; + this.acsCredentialPoolId = acsCredentialPoolId; + this.acsSystemId = acsSystemId; + this.parentAcsCredentialId = parentAcsCredentialId; + this.displayName = displayName; + this.code = code; + this.accessMethod = accessMethod; + this.externalType = externalType; + this.externalTypeDisplayName = externalTypeDisplayName; + this.createdAt = createdAt; + this.workspaceId = workspaceId; + this.startsAt = startsAt; + this.endsAt = endsAt; + this.errors = errors; + this.warnings = warnings; + this.isMultiPhoneSyncCredential = isMultiPhoneSyncCredential; + this.isLatestDesiredStateSyncedWithProvider = isLatestDesiredStateSyncedWithProvider; + this.latestDesiredStateSyncedWithProviderAt = latestDesiredStateSyncedWithProviderAt; + this.visionlineMetadata = visionlineMetadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_id") + public String getAcsCredentialId() { + return acsCredentialId; + } + + @JsonProperty("acs_user_id") + public Optional getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_credential_pool_id") + public Optional getAcsCredentialPoolId() { + return acsCredentialPoolId; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("parent_acs_credential_id") + public Optional getParentAcsCredentialId() { + return parentAcsCredentialId; + } + + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("code") + public Optional getCode() { + return code; + } + + @JsonProperty("access_method") + public AcsCredentialAccessMethod getAccessMethod() { + return accessMethod; + } + + @JsonProperty("external_type") + public Optional getExternalType() { + return externalType; + } + + @JsonProperty("external_type_display_name") + public Optional getExternalTypeDisplayName() { + return externalTypeDisplayName; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("starts_at") + public Optional getStartsAt() { + return startsAt; + } + + @JsonProperty("ends_at") + public Optional getEndsAt() { + return endsAt; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("is_multi_phone_sync_credential") + public Optional getIsMultiPhoneSyncCredential() { + return isMultiPhoneSyncCredential; + } + + @JsonProperty("is_latest_desired_state_synced_with_provider") + public Optional getIsLatestDesiredStateSyncedWithProvider() { + return isLatestDesiredStateSyncedWithProvider; + } + + @JsonProperty("latest_desired_state_synced_with_provider_at") + public Optional getLatestDesiredStateSyncedWithProviderAt() { + return latestDesiredStateSyncedWithProviderAt; + } + + @JsonProperty("visionline_metadata") + public Optional getVisionlineMetadata() { + return visionlineMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsCredential && equalTo((AcsCredential) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsCredential other) { + return acsCredentialId.equals(other.acsCredentialId) + && acsUserId.equals(other.acsUserId) + && acsCredentialPoolId.equals(other.acsCredentialPoolId) + && acsSystemId.equals(other.acsSystemId) + && parentAcsCredentialId.equals(other.parentAcsCredentialId) + && displayName.equals(other.displayName) + && code.equals(other.code) + && accessMethod.equals(other.accessMethod) + && externalType.equals(other.externalType) + && externalTypeDisplayName.equals(other.externalTypeDisplayName) + && createdAt.equals(other.createdAt) + && workspaceId.equals(other.workspaceId) + && startsAt.equals(other.startsAt) + && endsAt.equals(other.endsAt) + && errors.equals(other.errors) + && warnings.equals(other.warnings) + && isMultiPhoneSyncCredential.equals(other.isMultiPhoneSyncCredential) + && isLatestDesiredStateSyncedWithProvider.equals(other.isLatestDesiredStateSyncedWithProvider) + && latestDesiredStateSyncedWithProviderAt.equals(other.latestDesiredStateSyncedWithProviderAt) + && visionlineMetadata.equals(other.visionlineMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsCredentialId, + this.acsUserId, + this.acsCredentialPoolId, + this.acsSystemId, + this.parentAcsCredentialId, + this.displayName, + this.code, + this.accessMethod, + this.externalType, + this.externalTypeDisplayName, + this.createdAt, + this.workspaceId, + this.startsAt, + this.endsAt, + this.errors, + this.warnings, + this.isMultiPhoneSyncCredential, + this.isLatestDesiredStateSyncedWithProvider, + this.latestDesiredStateSyncedWithProviderAt, + this.visionlineMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialIdStage { + AcsSystemIdStage acsCredentialId(String acsCredentialId); + + Builder from(AcsCredential other); + } + + public interface AcsSystemIdStage { + DisplayNameStage acsSystemId(String acsSystemId); + } + + public interface DisplayNameStage { + AccessMethodStage displayName(String displayName); + } + + public interface AccessMethodStage { + CreatedAtStage accessMethod(AcsCredentialAccessMethod accessMethod); + } + + public interface CreatedAtStage { + WorkspaceIdStage createdAt(OffsetDateTime createdAt); + } + + public interface WorkspaceIdStage { + _FinalStage workspaceId(String workspaceId); + } + + public interface _FinalStage { + AcsCredential build(); + + _FinalStage acsUserId(Optional acsUserId); + + _FinalStage acsUserId(String acsUserId); + + _FinalStage acsCredentialPoolId(Optional acsCredentialPoolId); + + _FinalStage acsCredentialPoolId(String acsCredentialPoolId); + + _FinalStage parentAcsCredentialId(Optional parentAcsCredentialId); + + _FinalStage parentAcsCredentialId(String parentAcsCredentialId); + + _FinalStage code(Optional code); + + _FinalStage code(String code); + + _FinalStage externalType(Optional externalType); + + _FinalStage externalType(AcsCredentialExternalType externalType); + + _FinalStage externalTypeDisplayName(Optional externalTypeDisplayName); + + _FinalStage externalTypeDisplayName(String externalTypeDisplayName); + + _FinalStage startsAt(Optional startsAt); + + _FinalStage startsAt(String startsAt); + + _FinalStage endsAt(Optional endsAt); + + _FinalStage endsAt(String endsAt); + + _FinalStage errors(List errors); + + _FinalStage addErrors(AcsCredentialErrorsItem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(AcsCredentialWarningsItem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage isMultiPhoneSyncCredential(Optional isMultiPhoneSyncCredential); + + _FinalStage isMultiPhoneSyncCredential(Boolean isMultiPhoneSyncCredential); + + _FinalStage isLatestDesiredStateSyncedWithProvider(Optional isLatestDesiredStateSyncedWithProvider); + + _FinalStage isLatestDesiredStateSyncedWithProvider(Boolean isLatestDesiredStateSyncedWithProvider); + + _FinalStage latestDesiredStateSyncedWithProviderAt( + Optional latestDesiredStateSyncedWithProviderAt); + + _FinalStage latestDesiredStateSyncedWithProviderAt(OffsetDateTime latestDesiredStateSyncedWithProviderAt); + + _FinalStage visionlineMetadata(Optional visionlineMetadata); + + _FinalStage visionlineMetadata(AcsCredentialVisionlineMetadata visionlineMetadata); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsCredentialIdStage, + AcsSystemIdStage, + DisplayNameStage, + AccessMethodStage, + CreatedAtStage, + WorkspaceIdStage, + _FinalStage { + private String acsCredentialId; + + private String acsSystemId; + + private String displayName; + + private AcsCredentialAccessMethod accessMethod; + + private OffsetDateTime createdAt; + + private String workspaceId; + + private Optional visionlineMetadata = Optional.empty(); + + private Optional latestDesiredStateSyncedWithProviderAt = Optional.empty(); + + private Optional isLatestDesiredStateSyncedWithProvider = Optional.empty(); + + private Optional isMultiPhoneSyncCredential = Optional.empty(); + + private List warnings = new ArrayList<>(); + + private List errors = new ArrayList<>(); + + private Optional endsAt = Optional.empty(); + + private Optional startsAt = Optional.empty(); + + private Optional externalTypeDisplayName = Optional.empty(); + + private Optional externalType = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional parentAcsCredentialId = Optional.empty(); + + private Optional acsCredentialPoolId = Optional.empty(); + + private Optional acsUserId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsCredential other) { + acsCredentialId(other.getAcsCredentialId()); + acsUserId(other.getAcsUserId()); + acsCredentialPoolId(other.getAcsCredentialPoolId()); + acsSystemId(other.getAcsSystemId()); + parentAcsCredentialId(other.getParentAcsCredentialId()); + displayName(other.getDisplayName()); + code(other.getCode()); + accessMethod(other.getAccessMethod()); + externalType(other.getExternalType()); + externalTypeDisplayName(other.getExternalTypeDisplayName()); + createdAt(other.getCreatedAt()); + workspaceId(other.getWorkspaceId()); + startsAt(other.getStartsAt()); + endsAt(other.getEndsAt()); + errors(other.getErrors()); + warnings(other.getWarnings()); + isMultiPhoneSyncCredential(other.getIsMultiPhoneSyncCredential()); + isLatestDesiredStateSyncedWithProvider(other.getIsLatestDesiredStateSyncedWithProvider()); + latestDesiredStateSyncedWithProviderAt(other.getLatestDesiredStateSyncedWithProviderAt()); + visionlineMetadata(other.getVisionlineMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_id") + public AcsSystemIdStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public DisplayNameStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("display_name") + public AccessMethodStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + @JsonSetter("access_method") + public CreatedAtStage accessMethod(AcsCredentialAccessMethod accessMethod) { + this.accessMethod = accessMethod; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public WorkspaceIdStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public _FinalStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + public _FinalStage visionlineMetadata(AcsCredentialVisionlineMetadata visionlineMetadata) { + this.visionlineMetadata = Optional.of(visionlineMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "visionline_metadata", nulls = Nulls.SKIP) + public _FinalStage visionlineMetadata(Optional visionlineMetadata) { + this.visionlineMetadata = visionlineMetadata; + return this; + } + + @java.lang.Override + public _FinalStage latestDesiredStateSyncedWithProviderAt( + OffsetDateTime latestDesiredStateSyncedWithProviderAt) { + this.latestDesiredStateSyncedWithProviderAt = Optional.of(latestDesiredStateSyncedWithProviderAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "latest_desired_state_synced_with_provider_at", nulls = Nulls.SKIP) + public _FinalStage latestDesiredStateSyncedWithProviderAt( + Optional latestDesiredStateSyncedWithProviderAt) { + this.latestDesiredStateSyncedWithProviderAt = latestDesiredStateSyncedWithProviderAt; + return this; + } + + @java.lang.Override + public _FinalStage isLatestDesiredStateSyncedWithProvider(Boolean isLatestDesiredStateSyncedWithProvider) { + this.isLatestDesiredStateSyncedWithProvider = Optional.of(isLatestDesiredStateSyncedWithProvider); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_latest_desired_state_synced_with_provider", nulls = Nulls.SKIP) + public _FinalStage isLatestDesiredStateSyncedWithProvider( + Optional isLatestDesiredStateSyncedWithProvider) { + this.isLatestDesiredStateSyncedWithProvider = isLatestDesiredStateSyncedWithProvider; + return this; + } + + @java.lang.Override + public _FinalStage isMultiPhoneSyncCredential(Boolean isMultiPhoneSyncCredential) { + this.isMultiPhoneSyncCredential = Optional.of(isMultiPhoneSyncCredential); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_multi_phone_sync_credential", nulls = Nulls.SKIP) + public _FinalStage isMultiPhoneSyncCredential(Optional isMultiPhoneSyncCredential) { + this.isMultiPhoneSyncCredential = isMultiPhoneSyncCredential; + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(AcsCredentialWarningsItem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(AcsCredentialErrorsItem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage endsAt(String endsAt) { + this.endsAt = Optional.of(endsAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) + public _FinalStage endsAt(Optional endsAt) { + this.endsAt = endsAt; + return this; + } + + @java.lang.Override + public _FinalStage startsAt(String startsAt) { + this.startsAt = Optional.of(startsAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) + public _FinalStage startsAt(Optional startsAt) { + this.startsAt = startsAt; + return this; + } + + @java.lang.Override + public _FinalStage externalTypeDisplayName(String externalTypeDisplayName) { + this.externalTypeDisplayName = Optional.of(externalTypeDisplayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "external_type_display_name", nulls = Nulls.SKIP) + public _FinalStage externalTypeDisplayName(Optional externalTypeDisplayName) { + this.externalTypeDisplayName = externalTypeDisplayName; + return this; + } + + @java.lang.Override + public _FinalStage externalType(AcsCredentialExternalType externalType) { + this.externalType = Optional.of(externalType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "external_type", nulls = Nulls.SKIP) + public _FinalStage externalType(Optional externalType) { + this.externalType = externalType; + return this; + } + + @java.lang.Override + public _FinalStage code(String code) { + this.code = Optional.of(code); + return this; + } + + @java.lang.Override + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public _FinalStage code(Optional code) { + this.code = code; + return this; + } + + @java.lang.Override + public _FinalStage parentAcsCredentialId(String parentAcsCredentialId) { + this.parentAcsCredentialId = Optional.of(parentAcsCredentialId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "parent_acs_credential_id", nulls = Nulls.SKIP) + public _FinalStage parentAcsCredentialId(Optional parentAcsCredentialId) { + this.parentAcsCredentialId = parentAcsCredentialId; + return this; + } + + @java.lang.Override + public _FinalStage acsCredentialPoolId(String acsCredentialPoolId) { + this.acsCredentialPoolId = Optional.of(acsCredentialPoolId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_credential_pool_id", nulls = Nulls.SKIP) + public _FinalStage acsCredentialPoolId(Optional acsCredentialPoolId) { + this.acsCredentialPoolId = acsCredentialPoolId; + return this; + } + + @java.lang.Override + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = Optional.of(acsUserId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_user_id", nulls = Nulls.SKIP) + public _FinalStage acsUserId(Optional acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public AcsCredential build() { + return new AcsCredential( + acsCredentialId, + acsUserId, + acsCredentialPoolId, + acsSystemId, + parentAcsCredentialId, + displayName, + code, + accessMethod, + externalType, + externalTypeDisplayName, + createdAt, + workspaceId, + startsAt, + endsAt, + errors, + warnings, + isMultiPhoneSyncCredential, + isLatestDesiredStateSyncedWithProvider, + latestDesiredStateSyncedWithProviderAt, + visionlineMetadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedListResponseAccessCodesItemType.java b/src/main/java/com/seam/api/types/AcsCredentialAccessMethod.java similarity index 62% rename from src/main/java/com/seam/api/types/UnmanagedListResponseAccessCodesItemType.java rename to src/main/java/com/seam/api/types/AcsCredentialAccessMethod.java index ebe78f8..c3d7ab5 100644 --- a/src/main/java/com/seam/api/types/UnmanagedListResponseAccessCodesItemType.java +++ b/src/main/java/com/seam/api/types/AcsCredentialAccessMethod.java @@ -5,19 +5,21 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum UnmanagedListResponseAccessCodesItemType { - TIME_BOUND("time_bound"), +public enum AcsCredentialAccessMethod { + CODE("code"), - ONGOING("ongoing"); + CARD("card"), + + MOBILE_KEY("mobile_key"); private final String value; - UnmanagedListResponseAccessCodesItemType(String value) { + AcsCredentialAccessMethod(String value) { this.value = value; } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/AcsCredentialErrorsItem.java b/src/main/java/com/seam/api/types/AcsCredentialErrorsItem.java new file mode 100644 index 0000000..77f9932 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsCredentialErrorsItem.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsCredentialErrorsItem.Builder.class) +public final class AcsCredentialErrorsItem { + private final String errorCode; + + private final String message; + + private final Map additionalProperties; + + private AcsCredentialErrorsItem(String errorCode, String message, Map additionalProperties) { + this.errorCode = errorCode; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("error_code") + public String getErrorCode() { + return errorCode; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsCredentialErrorsItem && equalTo((AcsCredentialErrorsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsCredentialErrorsItem other) { + return errorCode.equals(other.errorCode) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.errorCode, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorCodeStage builder() { + return new Builder(); + } + + public interface ErrorCodeStage { + MessageStage errorCode(String errorCode); + + Builder from(AcsCredentialErrorsItem other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + AcsCredentialErrorsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorCodeStage, MessageStage, _FinalStage { + private String errorCode; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsCredentialErrorsItem other) { + errorCode(other.getErrorCode()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("error_code") + public MessageStage errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public AcsCredentialErrorsItem build() { + return new AcsCredentialErrorsItem(errorCode, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsCredentialExternalType.java b/src/main/java/com/seam/api/types/AcsCredentialExternalType.java new file mode 100644 index 0000000..6c3e705 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsCredentialExternalType.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsCredentialExternalType { + PTI_CARD("pti_card"), + + BRIVO_CREDENTIAL("brivo_credential"), + + HID_CREDENTIAL("hid_credential"), + + VISIONLINE_CARD("visionline_card"); + + private final String value; + + AcsCredentialExternalType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/AcsCredentialPool.java b/src/main/java/com/seam/api/types/AcsCredentialPool.java new file mode 100644 index 0000000..567cfaa --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsCredentialPool.java @@ -0,0 +1,249 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsCredentialPool.Builder.class) +public final class AcsCredentialPool { + private final String acsCredentialPoolId; + + private final String acsSystemId; + + private final String displayName; + + private final String externalTypeDisplayName; + + private final OffsetDateTime createdAt; + + private final String workspaceId; + + private final Map additionalProperties; + + private AcsCredentialPool( + String acsCredentialPoolId, + String acsSystemId, + String displayName, + String externalTypeDisplayName, + OffsetDateTime createdAt, + String workspaceId, + Map additionalProperties) { + this.acsCredentialPoolId = acsCredentialPoolId; + this.acsSystemId = acsSystemId; + this.displayName = displayName; + this.externalTypeDisplayName = externalTypeDisplayName; + this.createdAt = createdAt; + this.workspaceId = workspaceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_pool_id") + public String getAcsCredentialPoolId() { + return acsCredentialPoolId; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("external_type") + public String getExternalType() { + return "hid_part_number"; + } + + @JsonProperty("external_type_display_name") + public String getExternalTypeDisplayName() { + return externalTypeDisplayName; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsCredentialPool && equalTo((AcsCredentialPool) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsCredentialPool other) { + return acsCredentialPoolId.equals(other.acsCredentialPoolId) + && acsSystemId.equals(other.acsSystemId) + && displayName.equals(other.displayName) + && externalTypeDisplayName.equals(other.externalTypeDisplayName) + && createdAt.equals(other.createdAt) + && workspaceId.equals(other.workspaceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsCredentialPoolId, + this.acsSystemId, + this.displayName, + this.externalTypeDisplayName, + this.createdAt, + this.workspaceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialPoolIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialPoolIdStage { + AcsSystemIdStage acsCredentialPoolId(String acsCredentialPoolId); + + Builder from(AcsCredentialPool other); + } + + public interface AcsSystemIdStage { + DisplayNameStage acsSystemId(String acsSystemId); + } + + public interface DisplayNameStage { + ExternalTypeDisplayNameStage displayName(String displayName); + } + + public interface ExternalTypeDisplayNameStage { + CreatedAtStage externalTypeDisplayName(String externalTypeDisplayName); + } + + public interface CreatedAtStage { + WorkspaceIdStage createdAt(OffsetDateTime createdAt); + } + + public interface WorkspaceIdStage { + _FinalStage workspaceId(String workspaceId); + } + + public interface _FinalStage { + AcsCredentialPool build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsCredentialPoolIdStage, + AcsSystemIdStage, + DisplayNameStage, + ExternalTypeDisplayNameStage, + CreatedAtStage, + WorkspaceIdStage, + _FinalStage { + private String acsCredentialPoolId; + + private String acsSystemId; + + private String displayName; + + private String externalTypeDisplayName; + + private OffsetDateTime createdAt; + + private String workspaceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsCredentialPool other) { + acsCredentialPoolId(other.getAcsCredentialPoolId()); + acsSystemId(other.getAcsSystemId()); + displayName(other.getDisplayName()); + externalTypeDisplayName(other.getExternalTypeDisplayName()); + createdAt(other.getCreatedAt()); + workspaceId(other.getWorkspaceId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_pool_id") + public AcsSystemIdStage acsCredentialPoolId(String acsCredentialPoolId) { + this.acsCredentialPoolId = acsCredentialPoolId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public DisplayNameStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("display_name") + public ExternalTypeDisplayNameStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + @JsonSetter("external_type_display_name") + public CreatedAtStage externalTypeDisplayName(String externalTypeDisplayName) { + this.externalTypeDisplayName = externalTypeDisplayName; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public WorkspaceIdStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public _FinalStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + public AcsCredentialPool build() { + return new AcsCredentialPool( + acsCredentialPoolId, + acsSystemId, + displayName, + externalTypeDisplayName, + createdAt, + workspaceId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsCredentialProvisioningAutomation.java b/src/main/java/com/seam/api/types/AcsCredentialProvisioningAutomation.java new file mode 100644 index 0000000..c118b2a --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsCredentialProvisioningAutomation.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsCredentialProvisioningAutomation.Builder.class) +public final class AcsCredentialProvisioningAutomation { + private final String acsCredentialProvisioningAutomationId; + + private final String credentialManagerAcsSystemId; + + private final String userIdentityId; + + private final OffsetDateTime createdAt; + + private final String workspaceId; + + private final Map additionalProperties; + + private AcsCredentialProvisioningAutomation( + String acsCredentialProvisioningAutomationId, + String credentialManagerAcsSystemId, + String userIdentityId, + OffsetDateTime createdAt, + String workspaceId, + Map additionalProperties) { + this.acsCredentialProvisioningAutomationId = acsCredentialProvisioningAutomationId; + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + this.userIdentityId = userIdentityId; + this.createdAt = createdAt; + this.workspaceId = workspaceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_credential_provisioning_automation_id") + public String getAcsCredentialProvisioningAutomationId() { + return acsCredentialProvisioningAutomationId; + } + + @JsonProperty("credential_manager_acs_system_id") + public String getCredentialManagerAcsSystemId() { + return credentialManagerAcsSystemId; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsCredentialProvisioningAutomation + && equalTo((AcsCredentialProvisioningAutomation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsCredentialProvisioningAutomation other) { + return acsCredentialProvisioningAutomationId.equals(other.acsCredentialProvisioningAutomationId) + && credentialManagerAcsSystemId.equals(other.credentialManagerAcsSystemId) + && userIdentityId.equals(other.userIdentityId) + && createdAt.equals(other.createdAt) + && workspaceId.equals(other.workspaceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsCredentialProvisioningAutomationId, + this.credentialManagerAcsSystemId, + this.userIdentityId, + this.createdAt, + this.workspaceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsCredentialProvisioningAutomationIdStage builder() { + return new Builder(); + } + + public interface AcsCredentialProvisioningAutomationIdStage { + CredentialManagerAcsSystemIdStage acsCredentialProvisioningAutomationId( + String acsCredentialProvisioningAutomationId); + + Builder from(AcsCredentialProvisioningAutomation other); + } + + public interface CredentialManagerAcsSystemIdStage { + UserIdentityIdStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId); + } + + public interface UserIdentityIdStage { + CreatedAtStage userIdentityId(String userIdentityId); + } + + public interface CreatedAtStage { + WorkspaceIdStage createdAt(OffsetDateTime createdAt); + } + + public interface WorkspaceIdStage { + _FinalStage workspaceId(String workspaceId); + } + + public interface _FinalStage { + AcsCredentialProvisioningAutomation build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsCredentialProvisioningAutomationIdStage, + CredentialManagerAcsSystemIdStage, + UserIdentityIdStage, + CreatedAtStage, + WorkspaceIdStage, + _FinalStage { + private String acsCredentialProvisioningAutomationId; + + private String credentialManagerAcsSystemId; + + private String userIdentityId; + + private OffsetDateTime createdAt; + + private String workspaceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsCredentialProvisioningAutomation other) { + acsCredentialProvisioningAutomationId(other.getAcsCredentialProvisioningAutomationId()); + credentialManagerAcsSystemId(other.getCredentialManagerAcsSystemId()); + userIdentityId(other.getUserIdentityId()); + createdAt(other.getCreatedAt()); + workspaceId(other.getWorkspaceId()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_credential_provisioning_automation_id") + public CredentialManagerAcsSystemIdStage acsCredentialProvisioningAutomationId( + String acsCredentialProvisioningAutomationId) { + this.acsCredentialProvisioningAutomationId = acsCredentialProvisioningAutomationId; + return this; + } + + @java.lang.Override + @JsonSetter("credential_manager_acs_system_id") + public UserIdentityIdStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public CreatedAtStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public WorkspaceIdStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public _FinalStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + public AcsCredentialProvisioningAutomation build() { + return new AcsCredentialProvisioningAutomation( + acsCredentialProvisioningAutomationId, + credentialManagerAcsSystemId, + userIdentityId, + createdAt, + workspaceId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsCredentialVisionlineMetadata.java b/src/main/java/com/seam/api/types/AcsCredentialVisionlineMetadata.java new file mode 100644 index 0000000..4e02c67 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsCredentialVisionlineMetadata.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsCredentialVisionlineMetadata.Builder.class) +public final class AcsCredentialVisionlineMetadata { + private final AcsCredentialVisionlineMetadataCardFunctionType cardFunctionType; + + private final Optional> joinerAcsCredentialIds; + + private final Optional> guestAcsEntranceIds; + + private final Optional> commonAcsEntranceIds; + + private final Map additionalProperties; + + private AcsCredentialVisionlineMetadata( + AcsCredentialVisionlineMetadataCardFunctionType cardFunctionType, + Optional> joinerAcsCredentialIds, + Optional> guestAcsEntranceIds, + Optional> commonAcsEntranceIds, + Map additionalProperties) { + this.cardFunctionType = cardFunctionType; + this.joinerAcsCredentialIds = joinerAcsCredentialIds; + this.guestAcsEntranceIds = guestAcsEntranceIds; + this.commonAcsEntranceIds = commonAcsEntranceIds; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("card_function_type") + public AcsCredentialVisionlineMetadataCardFunctionType getCardFunctionType() { + return cardFunctionType; + } + + @JsonProperty("joiner_acs_credential_ids") + public Optional> getJoinerAcsCredentialIds() { + return joinerAcsCredentialIds; + } + + @JsonProperty("guest_acs_entrance_ids") + public Optional> getGuestAcsEntranceIds() { + return guestAcsEntranceIds; + } + + @JsonProperty("common_acs_entrance_ids") + public Optional> getCommonAcsEntranceIds() { + return commonAcsEntranceIds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsCredentialVisionlineMetadata && equalTo((AcsCredentialVisionlineMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsCredentialVisionlineMetadata other) { + return cardFunctionType.equals(other.cardFunctionType) + && joinerAcsCredentialIds.equals(other.joinerAcsCredentialIds) + && guestAcsEntranceIds.equals(other.guestAcsEntranceIds) + && commonAcsEntranceIds.equals(other.commonAcsEntranceIds); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cardFunctionType, + this.joinerAcsCredentialIds, + this.guestAcsEntranceIds, + this.commonAcsEntranceIds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CardFunctionTypeStage builder() { + return new Builder(); + } + + public interface CardFunctionTypeStage { + _FinalStage cardFunctionType(AcsCredentialVisionlineMetadataCardFunctionType cardFunctionType); + + Builder from(AcsCredentialVisionlineMetadata other); + } + + public interface _FinalStage { + AcsCredentialVisionlineMetadata build(); + + _FinalStage joinerAcsCredentialIds(Optional> joinerAcsCredentialIds); + + _FinalStage joinerAcsCredentialIds(List joinerAcsCredentialIds); + + _FinalStage guestAcsEntranceIds(Optional> guestAcsEntranceIds); + + _FinalStage guestAcsEntranceIds(List guestAcsEntranceIds); + + _FinalStage commonAcsEntranceIds(Optional> commonAcsEntranceIds); + + _FinalStage commonAcsEntranceIds(List commonAcsEntranceIds); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CardFunctionTypeStage, _FinalStage { + private AcsCredentialVisionlineMetadataCardFunctionType cardFunctionType; + + private Optional> commonAcsEntranceIds = Optional.empty(); + + private Optional> guestAcsEntranceIds = Optional.empty(); + + private Optional> joinerAcsCredentialIds = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsCredentialVisionlineMetadata other) { + cardFunctionType(other.getCardFunctionType()); + joinerAcsCredentialIds(other.getJoinerAcsCredentialIds()); + guestAcsEntranceIds(other.getGuestAcsEntranceIds()); + commonAcsEntranceIds(other.getCommonAcsEntranceIds()); + return this; + } + + @java.lang.Override + @JsonSetter("card_function_type") + public _FinalStage cardFunctionType(AcsCredentialVisionlineMetadataCardFunctionType cardFunctionType) { + this.cardFunctionType = cardFunctionType; + return this; + } + + @java.lang.Override + public _FinalStage commonAcsEntranceIds(List commonAcsEntranceIds) { + this.commonAcsEntranceIds = Optional.of(commonAcsEntranceIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "common_acs_entrance_ids", nulls = Nulls.SKIP) + public _FinalStage commonAcsEntranceIds(Optional> commonAcsEntranceIds) { + this.commonAcsEntranceIds = commonAcsEntranceIds; + return this; + } + + @java.lang.Override + public _FinalStage guestAcsEntranceIds(List guestAcsEntranceIds) { + this.guestAcsEntranceIds = Optional.of(guestAcsEntranceIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "guest_acs_entrance_ids", nulls = Nulls.SKIP) + public _FinalStage guestAcsEntranceIds(Optional> guestAcsEntranceIds) { + this.guestAcsEntranceIds = guestAcsEntranceIds; + return this; + } + + @java.lang.Override + public _FinalStage joinerAcsCredentialIds(List joinerAcsCredentialIds) { + this.joinerAcsCredentialIds = Optional.of(joinerAcsCredentialIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "joiner_acs_credential_ids", nulls = Nulls.SKIP) + public _FinalStage joinerAcsCredentialIds(Optional> joinerAcsCredentialIds) { + this.joinerAcsCredentialIds = joinerAcsCredentialIds; + return this; + } + + @java.lang.Override + public AcsCredentialVisionlineMetadata build() { + return new AcsCredentialVisionlineMetadata( + cardFunctionType, + joinerAcsCredentialIds, + guestAcsEntranceIds, + commonAcsEntranceIds, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersRequestProviderCategory.java b/src/main/java/com/seam/api/types/AcsCredentialVisionlineMetadataCardFunctionType.java similarity index 58% rename from src/main/java/com/seam/api/types/DevicesListDeviceProvidersRequestProviderCategory.java rename to src/main/java/com/seam/api/types/AcsCredentialVisionlineMetadataCardFunctionType.java index f142b66..8520a5b 100644 --- a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersRequestProviderCategory.java +++ b/src/main/java/com/seam/api/types/AcsCredentialVisionlineMetadataCardFunctionType.java @@ -5,19 +5,19 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DevicesListDeviceProvidersRequestProviderCategory { - STABLE("stable"), +public enum AcsCredentialVisionlineMetadataCardFunctionType { + GUEST("guest"), - CONSUMER_SMARTLOCKS("consumer_smartlocks"); + STAFF("staff"); private final String value; - DevicesListDeviceProvidersRequestProviderCategory(String value) { + AcsCredentialVisionlineMetadataCardFunctionType(String value) { this.value = value; } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/AcsCredentialWarningsItem.java b/src/main/java/com/seam/api/types/AcsCredentialWarningsItem.java new file mode 100644 index 0000000..4357073 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsCredentialWarningsItem.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsCredentialWarningsItem.Builder.class) +public final class AcsCredentialWarningsItem { + private final String warningCode; + + private final String message; + + private final Map additionalProperties; + + private AcsCredentialWarningsItem(String warningCode, String message, Map additionalProperties) { + this.warningCode = warningCode; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("warning_code") + public String getWarningCode() { + return warningCode; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsCredentialWarningsItem && equalTo((AcsCredentialWarningsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsCredentialWarningsItem other) { + return warningCode.equals(other.warningCode) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.warningCode, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static WarningCodeStage builder() { + return new Builder(); + } + + public interface WarningCodeStage { + MessageStage warningCode(String warningCode); + + Builder from(AcsCredentialWarningsItem other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + AcsCredentialWarningsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements WarningCodeStage, MessageStage, _FinalStage { + private String warningCode; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsCredentialWarningsItem other) { + warningCode(other.getWarningCode()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("warning_code") + public MessageStage warningCode(String warningCode) { + this.warningCode = warningCode; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public AcsCredentialWarningsItem build() { + return new AcsCredentialWarningsItem(warningCode, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsEntrance.java b/src/main/java/com/seam/api/types/AcsEntrance.java new file mode 100644 index 0000000..19dd4b9 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsEntrance.java @@ -0,0 +1,295 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsEntrance.Builder.class) +public final class AcsEntrance { + private final String acsSystemId; + + private final String acsEntranceId; + + private final OffsetDateTime createdAt; + + private final String displayName; + + private final List errors; + + private final Optional latchMetadata; + + private final Optional visionlineMetadata; + + private final Map additionalProperties; + + private AcsEntrance( + String acsSystemId, + String acsEntranceId, + OffsetDateTime createdAt, + String displayName, + List errors, + Optional latchMetadata, + Optional visionlineMetadata, + Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.acsEntranceId = acsEntranceId; + this.createdAt = createdAt; + this.displayName = displayName; + this.errors = errors; + this.latchMetadata = latchMetadata; + this.visionlineMetadata = visionlineMetadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("acs_entrance_id") + public String getAcsEntranceId() { + return acsEntranceId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("latch_metadata") + public Optional getLatchMetadata() { + return latchMetadata; + } + + @JsonProperty("visionline_metadata") + public Optional getVisionlineMetadata() { + return visionlineMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsEntrance && equalTo((AcsEntrance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsEntrance other) { + return acsSystemId.equals(other.acsSystemId) + && acsEntranceId.equals(other.acsEntranceId) + && createdAt.equals(other.createdAt) + && displayName.equals(other.displayName) + && errors.equals(other.errors) + && latchMetadata.equals(other.latchMetadata) + && visionlineMetadata.equals(other.visionlineMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsSystemId, + this.acsEntranceId, + this.createdAt, + this.displayName, + this.errors, + this.latchMetadata, + this.visionlineMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsSystemIdStage builder() { + return new Builder(); + } + + public interface AcsSystemIdStage { + AcsEntranceIdStage acsSystemId(String acsSystemId); + + Builder from(AcsEntrance other); + } + + public interface AcsEntranceIdStage { + CreatedAtStage acsEntranceId(String acsEntranceId); + } + + public interface CreatedAtStage { + DisplayNameStage createdAt(OffsetDateTime createdAt); + } + + public interface DisplayNameStage { + _FinalStage displayName(String displayName); + } + + public interface _FinalStage { + AcsEntrance build(); + + _FinalStage errors(List errors); + + _FinalStage addErrors(AcsEntranceErrorsItem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage latchMetadata(Optional latchMetadata); + + _FinalStage latchMetadata(AcsEntranceLatchMetadata latchMetadata); + + _FinalStage visionlineMetadata(Optional visionlineMetadata); + + _FinalStage visionlineMetadata(AcsEntranceVisionlineMetadata visionlineMetadata); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsSystemIdStage, AcsEntranceIdStage, CreatedAtStage, DisplayNameStage, _FinalStage { + private String acsSystemId; + + private String acsEntranceId; + + private OffsetDateTime createdAt; + + private String displayName; + + private Optional visionlineMetadata = Optional.empty(); + + private Optional latchMetadata = Optional.empty(); + + private List errors = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsEntrance other) { + acsSystemId(other.getAcsSystemId()); + acsEntranceId(other.getAcsEntranceId()); + createdAt(other.getCreatedAt()); + displayName(other.getDisplayName()); + errors(other.getErrors()); + latchMetadata(other.getLatchMetadata()); + visionlineMetadata(other.getVisionlineMetadata()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public AcsEntranceIdStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_entrance_id") + public CreatedAtStage acsEntranceId(String acsEntranceId) { + this.acsEntranceId = acsEntranceId; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public DisplayNameStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("display_name") + public _FinalStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public _FinalStage visionlineMetadata(AcsEntranceVisionlineMetadata visionlineMetadata) { + this.visionlineMetadata = Optional.of(visionlineMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "visionline_metadata", nulls = Nulls.SKIP) + public _FinalStage visionlineMetadata(Optional visionlineMetadata) { + this.visionlineMetadata = visionlineMetadata; + return this; + } + + @java.lang.Override + public _FinalStage latchMetadata(AcsEntranceLatchMetadata latchMetadata) { + this.latchMetadata = Optional.of(latchMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "latch_metadata", nulls = Nulls.SKIP) + public _FinalStage latchMetadata(Optional latchMetadata) { + this.latchMetadata = latchMetadata; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(AcsEntranceErrorsItem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public AcsEntrance build() { + return new AcsEntrance( + acsSystemId, + acsEntranceId, + createdAt, + displayName, + errors, + latchMetadata, + visionlineMetadata, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsEntranceErrorsItem.java b/src/main/java/com/seam/api/types/AcsEntranceErrorsItem.java new file mode 100644 index 0000000..2c89a8b --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsEntranceErrorsItem.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsEntranceErrorsItem.Builder.class) +public final class AcsEntranceErrorsItem { + private final String errorCode; + + private final String message; + + private final Map additionalProperties; + + private AcsEntranceErrorsItem(String errorCode, String message, Map additionalProperties) { + this.errorCode = errorCode; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("error_code") + public String getErrorCode() { + return errorCode; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsEntranceErrorsItem && equalTo((AcsEntranceErrorsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsEntranceErrorsItem other) { + return errorCode.equals(other.errorCode) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.errorCode, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorCodeStage builder() { + return new Builder(); + } + + public interface ErrorCodeStage { + MessageStage errorCode(String errorCode); + + Builder from(AcsEntranceErrorsItem other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + AcsEntranceErrorsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorCodeStage, MessageStage, _FinalStage { + private String errorCode; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsEntranceErrorsItem other) { + errorCode(other.getErrorCode()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("error_code") + public MessageStage errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public AcsEntranceErrorsItem build() { + return new AcsEntranceErrorsItem(errorCode, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsEntranceLatchMetadata.java b/src/main/java/com/seam/api/types/AcsEntranceLatchMetadata.java new file mode 100644 index 0000000..90a36e2 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsEntranceLatchMetadata.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsEntranceLatchMetadata.Builder.class) +public final class AcsEntranceLatchMetadata { + private final String accessibilityType; + + private final String doorName; + + private final String doorType; + + private final boolean isConnected; + + private final Map additionalProperties; + + private AcsEntranceLatchMetadata( + String accessibilityType, + String doorName, + String doorType, + boolean isConnected, + Map additionalProperties) { + this.accessibilityType = accessibilityType; + this.doorName = doorName; + this.doorType = doorType; + this.isConnected = isConnected; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("accessibility_type") + public String getAccessibilityType() { + return accessibilityType; + } + + @JsonProperty("door_name") + public String getDoorName() { + return doorName; + } + + @JsonProperty("door_type") + public String getDoorType() { + return doorType; + } + + @JsonProperty("is_connected") + public boolean getIsConnected() { + return isConnected; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsEntranceLatchMetadata && equalTo((AcsEntranceLatchMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsEntranceLatchMetadata other) { + return accessibilityType.equals(other.accessibilityType) + && doorName.equals(other.doorName) + && doorType.equals(other.doorType) + && isConnected == other.isConnected; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accessibilityType, this.doorName, this.doorType, this.isConnected); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccessibilityTypeStage builder() { + return new Builder(); + } + + public interface AccessibilityTypeStage { + DoorNameStage accessibilityType(String accessibilityType); + + Builder from(AcsEntranceLatchMetadata other); + } + + public interface DoorNameStage { + DoorTypeStage doorName(String doorName); + } + + public interface DoorTypeStage { + IsConnectedStage doorType(String doorType); + } + + public interface IsConnectedStage { + _FinalStage isConnected(boolean isConnected); + } + + public interface _FinalStage { + AcsEntranceLatchMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AccessibilityTypeStage, DoorNameStage, DoorTypeStage, IsConnectedStage, _FinalStage { + private String accessibilityType; + + private String doorName; + + private String doorType; + + private boolean isConnected; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsEntranceLatchMetadata other) { + accessibilityType(other.getAccessibilityType()); + doorName(other.getDoorName()); + doorType(other.getDoorType()); + isConnected(other.getIsConnected()); + return this; + } + + @java.lang.Override + @JsonSetter("accessibility_type") + public DoorNameStage accessibilityType(String accessibilityType) { + this.accessibilityType = accessibilityType; + return this; + } + + @java.lang.Override + @JsonSetter("door_name") + public DoorTypeStage doorName(String doorName) { + this.doorName = doorName; + return this; + } + + @java.lang.Override + @JsonSetter("door_type") + public IsConnectedStage doorType(String doorType) { + this.doorType = doorType; + return this; + } + + @java.lang.Override + @JsonSetter("is_connected") + public _FinalStage isConnected(boolean isConnected) { + this.isConnected = isConnected; + return this; + } + + @java.lang.Override + public AcsEntranceLatchMetadata build() { + return new AcsEntranceLatchMetadata( + accessibilityType, doorName, doorType, isConnected, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadata.java b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadata.java new file mode 100644 index 0000000..4dad7dd --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadata.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsEntranceVisionlineMetadata.Builder.class) +public final class AcsEntranceVisionlineMetadata { + private final String doorName; + + private final AcsEntranceVisionlineMetadataDoorCategory doorCategory; + + private final Optional> profiles; + + private final Map additionalProperties; + + private AcsEntranceVisionlineMetadata( + String doorName, + AcsEntranceVisionlineMetadataDoorCategory doorCategory, + Optional> profiles, + Map additionalProperties) { + this.doorName = doorName; + this.doorCategory = doorCategory; + this.profiles = profiles; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("door_name") + public String getDoorName() { + return doorName; + } + + @JsonProperty("door_category") + public AcsEntranceVisionlineMetadataDoorCategory getDoorCategory() { + return doorCategory; + } + + @JsonProperty("profiles") + public Optional> getProfiles() { + return profiles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsEntranceVisionlineMetadata && equalTo((AcsEntranceVisionlineMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsEntranceVisionlineMetadata other) { + return doorName.equals(other.doorName) + && doorCategory.equals(other.doorCategory) + && profiles.equals(other.profiles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.doorName, this.doorCategory, this.profiles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DoorNameStage builder() { + return new Builder(); + } + + public interface DoorNameStage { + DoorCategoryStage doorName(String doorName); + + Builder from(AcsEntranceVisionlineMetadata other); + } + + public interface DoorCategoryStage { + _FinalStage doorCategory(AcsEntranceVisionlineMetadataDoorCategory doorCategory); + } + + public interface _FinalStage { + AcsEntranceVisionlineMetadata build(); + + _FinalStage profiles(Optional> profiles); + + _FinalStage profiles(List profiles); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DoorNameStage, DoorCategoryStage, _FinalStage { + private String doorName; + + private AcsEntranceVisionlineMetadataDoorCategory doorCategory; + + private Optional> profiles = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsEntranceVisionlineMetadata other) { + doorName(other.getDoorName()); + doorCategory(other.getDoorCategory()); + profiles(other.getProfiles()); + return this; + } + + @java.lang.Override + @JsonSetter("door_name") + public DoorCategoryStage doorName(String doorName) { + this.doorName = doorName; + return this; + } + + @java.lang.Override + @JsonSetter("door_category") + public _FinalStage doorCategory(AcsEntranceVisionlineMetadataDoorCategory doorCategory) { + this.doorCategory = doorCategory; + return this; + } + + @java.lang.Override + public _FinalStage profiles(List profiles) { + this.profiles = Optional.of(profiles); + return this; + } + + @java.lang.Override + @JsonSetter(value = "profiles", nulls = Nulls.SKIP) + public _FinalStage profiles(Optional> profiles) { + this.profiles = profiles; + return this; + } + + @java.lang.Override + public AcsEntranceVisionlineMetadata build() { + return new AcsEntranceVisionlineMetadata(doorName, doorCategory, profiles, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataDoorCategory.java b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataDoorCategory.java new file mode 100644 index 0000000..01b393e --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataDoorCategory.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsEntranceVisionlineMetadataDoorCategory { + ENTRANCE("entrance"), + + GUEST("guest"), + + ELEVATOR_READER("elevator reader"), + + COMMON("common"), + + COMMON_PMS("common (PMS)"); + + private final String value; + + AcsEntranceVisionlineMetadataDoorCategory(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItem.java b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItem.java new file mode 100644 index 0000000..768054c --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItem.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsEntranceVisionlineMetadataProfilesItem.Builder.class) +public final class AcsEntranceVisionlineMetadataProfilesItem { + private final String visionlineDoorProfileId; + + private final AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType visionlineDoorProfileType; + + private final Map additionalProperties; + + private AcsEntranceVisionlineMetadataProfilesItem( + String visionlineDoorProfileId, + AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType visionlineDoorProfileType, + Map additionalProperties) { + this.visionlineDoorProfileId = visionlineDoorProfileId; + this.visionlineDoorProfileType = visionlineDoorProfileType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("visionline_door_profile_id") + public String getVisionlineDoorProfileId() { + return visionlineDoorProfileId; + } + + @JsonProperty("visionline_door_profile_type") + public AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType getVisionlineDoorProfileType() { + return visionlineDoorProfileType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsEntranceVisionlineMetadataProfilesItem + && equalTo((AcsEntranceVisionlineMetadataProfilesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsEntranceVisionlineMetadataProfilesItem other) { + return visionlineDoorProfileId.equals(other.visionlineDoorProfileId) + && visionlineDoorProfileType.equals(other.visionlineDoorProfileType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.visionlineDoorProfileId, this.visionlineDoorProfileType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static VisionlineDoorProfileIdStage builder() { + return new Builder(); + } + + public interface VisionlineDoorProfileIdStage { + VisionlineDoorProfileTypeStage visionlineDoorProfileId(String visionlineDoorProfileId); + + Builder from(AcsEntranceVisionlineMetadataProfilesItem other); + } + + public interface VisionlineDoorProfileTypeStage { + _FinalStage visionlineDoorProfileType( + AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType visionlineDoorProfileType); + } + + public interface _FinalStage { + AcsEntranceVisionlineMetadataProfilesItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements VisionlineDoorProfileIdStage, VisionlineDoorProfileTypeStage, _FinalStage { + private String visionlineDoorProfileId; + + private AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType visionlineDoorProfileType; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsEntranceVisionlineMetadataProfilesItem other) { + visionlineDoorProfileId(other.getVisionlineDoorProfileId()); + visionlineDoorProfileType(other.getVisionlineDoorProfileType()); + return this; + } + + @java.lang.Override + @JsonSetter("visionline_door_profile_id") + public VisionlineDoorProfileTypeStage visionlineDoorProfileId(String visionlineDoorProfileId) { + this.visionlineDoorProfileId = visionlineDoorProfileId; + return this; + } + + @java.lang.Override + @JsonSetter("visionline_door_profile_type") + public _FinalStage visionlineDoorProfileType( + AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType visionlineDoorProfileType) { + this.visionlineDoorProfileType = visionlineDoorProfileType; + return this; + } + + @java.lang.Override + public AcsEntranceVisionlineMetadataProfilesItem build() { + return new AcsEntranceVisionlineMetadataProfilesItem( + visionlineDoorProfileId, visionlineDoorProfileType, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType.java b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType.java new file mode 100644 index 0000000..d545427 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType { + BLE("BLE"), + + COMMON_DOOR("commonDoor"), + + TOUCH("touch"); + + private final String value; + + AcsEntranceVisionlineMetadataProfilesItemVisionlineDoorProfileType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/AcsSystem.java b/src/main/java/com/seam/api/types/AcsSystem.java new file mode 100644 index 0000000..4c12ea6 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsSystem.java @@ -0,0 +1,628 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsSystem.Builder.class) +public final class AcsSystem { + private final String acsSystemId; + + private final Optional externalType; + + private final Optional externalTypeDisplayName; + + private final Optional systemType; + + private final Optional systemTypeDisplayName; + + private final String name; + + private final OffsetDateTime createdAt; + + private final String workspaceId; + + private final List connectedAccountIds; + + private final String imageUrl; + + private final String imageAltText; + + private final List errors; + + private final List warnings; + + private final Optional canAutomateEnrollment; + + private final Optional canCreateAcsAccessGroups; + + private final Optional canRemoveAcsUsersFromAcsAccessGroups; + + private final Optional canAddAcsUsersToAcsAccessGroups; + + private final Map additionalProperties; + + private AcsSystem( + String acsSystemId, + Optional externalType, + Optional externalTypeDisplayName, + Optional systemType, + Optional systemTypeDisplayName, + String name, + OffsetDateTime createdAt, + String workspaceId, + List connectedAccountIds, + String imageUrl, + String imageAltText, + List errors, + List warnings, + Optional canAutomateEnrollment, + Optional canCreateAcsAccessGroups, + Optional canRemoveAcsUsersFromAcsAccessGroups, + Optional canAddAcsUsersToAcsAccessGroups, + Map additionalProperties) { + this.acsSystemId = acsSystemId; + this.externalType = externalType; + this.externalTypeDisplayName = externalTypeDisplayName; + this.systemType = systemType; + this.systemTypeDisplayName = systemTypeDisplayName; + this.name = name; + this.createdAt = createdAt; + this.workspaceId = workspaceId; + this.connectedAccountIds = connectedAccountIds; + this.imageUrl = imageUrl; + this.imageAltText = imageAltText; + this.errors = errors; + this.warnings = warnings; + this.canAutomateEnrollment = canAutomateEnrollment; + this.canCreateAcsAccessGroups = canCreateAcsAccessGroups; + this.canRemoveAcsUsersFromAcsAccessGroups = canRemoveAcsUsersFromAcsAccessGroups; + this.canAddAcsUsersToAcsAccessGroups = canAddAcsUsersToAcsAccessGroups; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("external_type") + public Optional getExternalType() { + return externalType; + } + + @JsonProperty("external_type_display_name") + public Optional getExternalTypeDisplayName() { + return externalTypeDisplayName; + } + + @JsonProperty("system_type") + public Optional getSystemType() { + return systemType; + } + + @JsonProperty("system_type_display_name") + public Optional getSystemTypeDisplayName() { + return systemTypeDisplayName; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("connected_account_ids") + public List getConnectedAccountIds() { + return connectedAccountIds; + } + + @JsonProperty("image_url") + public String getImageUrl() { + return imageUrl; + } + + @JsonProperty("image_alt_text") + public String getImageAltText() { + return imageAltText; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("can_automate_enrollment") + public Optional getCanAutomateEnrollment() { + return canAutomateEnrollment; + } + + @JsonProperty("can_create_acs_access_groups") + public Optional getCanCreateAcsAccessGroups() { + return canCreateAcsAccessGroups; + } + + @JsonProperty("can_remove_acs_users_from_acs_access_groups") + public Optional getCanRemoveAcsUsersFromAcsAccessGroups() { + return canRemoveAcsUsersFromAcsAccessGroups; + } + + @JsonProperty("can_add_acs_users_to_acs_access_groups") + public Optional getCanAddAcsUsersToAcsAccessGroups() { + return canAddAcsUsersToAcsAccessGroups; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsSystem && equalTo((AcsSystem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsSystem other) { + return acsSystemId.equals(other.acsSystemId) + && externalType.equals(other.externalType) + && externalTypeDisplayName.equals(other.externalTypeDisplayName) + && systemType.equals(other.systemType) + && systemTypeDisplayName.equals(other.systemTypeDisplayName) + && name.equals(other.name) + && createdAt.equals(other.createdAt) + && workspaceId.equals(other.workspaceId) + && connectedAccountIds.equals(other.connectedAccountIds) + && imageUrl.equals(other.imageUrl) + && imageAltText.equals(other.imageAltText) + && errors.equals(other.errors) + && warnings.equals(other.warnings) + && canAutomateEnrollment.equals(other.canAutomateEnrollment) + && canCreateAcsAccessGroups.equals(other.canCreateAcsAccessGroups) + && canRemoveAcsUsersFromAcsAccessGroups.equals(other.canRemoveAcsUsersFromAcsAccessGroups) + && canAddAcsUsersToAcsAccessGroups.equals(other.canAddAcsUsersToAcsAccessGroups); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsSystemId, + this.externalType, + this.externalTypeDisplayName, + this.systemType, + this.systemTypeDisplayName, + this.name, + this.createdAt, + this.workspaceId, + this.connectedAccountIds, + this.imageUrl, + this.imageAltText, + this.errors, + this.warnings, + this.canAutomateEnrollment, + this.canCreateAcsAccessGroups, + this.canRemoveAcsUsersFromAcsAccessGroups, + this.canAddAcsUsersToAcsAccessGroups); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsSystemIdStage builder() { + return new Builder(); + } + + public interface AcsSystemIdStage { + NameStage acsSystemId(String acsSystemId); + + Builder from(AcsSystem other); + } + + public interface NameStage { + CreatedAtStage name(String name); + } + + public interface CreatedAtStage { + WorkspaceIdStage createdAt(OffsetDateTime createdAt); + } + + public interface WorkspaceIdStage { + ImageUrlStage workspaceId(String workspaceId); + } + + public interface ImageUrlStage { + ImageAltTextStage imageUrl(String imageUrl); + } + + public interface ImageAltTextStage { + _FinalStage imageAltText(String imageAltText); + } + + public interface _FinalStage { + AcsSystem build(); + + _FinalStage externalType(Optional externalType); + + _FinalStage externalType(AcsSystemExternalType externalType); + + _FinalStage externalTypeDisplayName(Optional externalTypeDisplayName); + + _FinalStage externalTypeDisplayName(String externalTypeDisplayName); + + _FinalStage systemType(Optional systemType); + + _FinalStage systemType(AcsSystemSystemType systemType); + + _FinalStage systemTypeDisplayName(Optional systemTypeDisplayName); + + _FinalStage systemTypeDisplayName(String systemTypeDisplayName); + + _FinalStage connectedAccountIds(List connectedAccountIds); + + _FinalStage addConnectedAccountIds(String connectedAccountIds); + + _FinalStage addAllConnectedAccountIds(List connectedAccountIds); + + _FinalStage errors(List errors); + + _FinalStage addErrors(AcsSystemErrorsItem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(AcsSystemWarningsItem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage canAutomateEnrollment(Optional canAutomateEnrollment); + + _FinalStage canAutomateEnrollment(Boolean canAutomateEnrollment); + + _FinalStage canCreateAcsAccessGroups(Optional canCreateAcsAccessGroups); + + _FinalStage canCreateAcsAccessGroups(Boolean canCreateAcsAccessGroups); + + _FinalStage canRemoveAcsUsersFromAcsAccessGroups(Optional canRemoveAcsUsersFromAcsAccessGroups); + + _FinalStage canRemoveAcsUsersFromAcsAccessGroups(Boolean canRemoveAcsUsersFromAcsAccessGroups); + + _FinalStage canAddAcsUsersToAcsAccessGroups(Optional canAddAcsUsersToAcsAccessGroups); + + _FinalStage canAddAcsUsersToAcsAccessGroups(Boolean canAddAcsUsersToAcsAccessGroups); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsSystemIdStage, + NameStage, + CreatedAtStage, + WorkspaceIdStage, + ImageUrlStage, + ImageAltTextStage, + _FinalStage { + private String acsSystemId; + + private String name; + + private OffsetDateTime createdAt; + + private String workspaceId; + + private String imageUrl; + + private String imageAltText; + + private Optional canAddAcsUsersToAcsAccessGroups = Optional.empty(); + + private Optional canRemoveAcsUsersFromAcsAccessGroups = Optional.empty(); + + private Optional canCreateAcsAccessGroups = Optional.empty(); + + private Optional canAutomateEnrollment = Optional.empty(); + + private List warnings = new ArrayList<>(); + + private List errors = new ArrayList<>(); + + private List connectedAccountIds = new ArrayList<>(); + + private Optional systemTypeDisplayName = Optional.empty(); + + private Optional systemType = Optional.empty(); + + private Optional externalTypeDisplayName = Optional.empty(); + + private Optional externalType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsSystem other) { + acsSystemId(other.getAcsSystemId()); + externalType(other.getExternalType()); + externalTypeDisplayName(other.getExternalTypeDisplayName()); + systemType(other.getSystemType()); + systemTypeDisplayName(other.getSystemTypeDisplayName()); + name(other.getName()); + createdAt(other.getCreatedAt()); + workspaceId(other.getWorkspaceId()); + connectedAccountIds(other.getConnectedAccountIds()); + imageUrl(other.getImageUrl()); + imageAltText(other.getImageAltText()); + errors(other.getErrors()); + warnings(other.getWarnings()); + canAutomateEnrollment(other.getCanAutomateEnrollment()); + canCreateAcsAccessGroups(other.getCanCreateAcsAccessGroups()); + canRemoveAcsUsersFromAcsAccessGroups(other.getCanRemoveAcsUsersFromAcsAccessGroups()); + canAddAcsUsersToAcsAccessGroups(other.getCanAddAcsUsersToAcsAccessGroups()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public NameStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public WorkspaceIdStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public ImageUrlStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + @JsonSetter("image_url") + public ImageAltTextStage imageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + @java.lang.Override + @JsonSetter("image_alt_text") + public _FinalStage imageAltText(String imageAltText) { + this.imageAltText = imageAltText; + return this; + } + + @java.lang.Override + public _FinalStage canAddAcsUsersToAcsAccessGroups(Boolean canAddAcsUsersToAcsAccessGroups) { + this.canAddAcsUsersToAcsAccessGroups = Optional.of(canAddAcsUsersToAcsAccessGroups); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_add_acs_users_to_acs_access_groups", nulls = Nulls.SKIP) + public _FinalStage canAddAcsUsersToAcsAccessGroups(Optional canAddAcsUsersToAcsAccessGroups) { + this.canAddAcsUsersToAcsAccessGroups = canAddAcsUsersToAcsAccessGroups; + return this; + } + + @java.lang.Override + public _FinalStage canRemoveAcsUsersFromAcsAccessGroups(Boolean canRemoveAcsUsersFromAcsAccessGroups) { + this.canRemoveAcsUsersFromAcsAccessGroups = Optional.of(canRemoveAcsUsersFromAcsAccessGroups); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_remove_acs_users_from_acs_access_groups", nulls = Nulls.SKIP) + public _FinalStage canRemoveAcsUsersFromAcsAccessGroups( + Optional canRemoveAcsUsersFromAcsAccessGroups) { + this.canRemoveAcsUsersFromAcsAccessGroups = canRemoveAcsUsersFromAcsAccessGroups; + return this; + } + + @java.lang.Override + public _FinalStage canCreateAcsAccessGroups(Boolean canCreateAcsAccessGroups) { + this.canCreateAcsAccessGroups = Optional.of(canCreateAcsAccessGroups); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_create_acs_access_groups", nulls = Nulls.SKIP) + public _FinalStage canCreateAcsAccessGroups(Optional canCreateAcsAccessGroups) { + this.canCreateAcsAccessGroups = canCreateAcsAccessGroups; + return this; + } + + @java.lang.Override + public _FinalStage canAutomateEnrollment(Boolean canAutomateEnrollment) { + this.canAutomateEnrollment = Optional.of(canAutomateEnrollment); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_automate_enrollment", nulls = Nulls.SKIP) + public _FinalStage canAutomateEnrollment(Optional canAutomateEnrollment) { + this.canAutomateEnrollment = canAutomateEnrollment; + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(AcsSystemWarningsItem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(AcsSystemErrorsItem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addAllConnectedAccountIds(List connectedAccountIds) { + this.connectedAccountIds.addAll(connectedAccountIds); + return this; + } + + @java.lang.Override + public _FinalStage addConnectedAccountIds(String connectedAccountIds) { + this.connectedAccountIds.add(connectedAccountIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "connected_account_ids", nulls = Nulls.SKIP) + public _FinalStage connectedAccountIds(List connectedAccountIds) { + this.connectedAccountIds.clear(); + this.connectedAccountIds.addAll(connectedAccountIds); + return this; + } + + @java.lang.Override + public _FinalStage systemTypeDisplayName(String systemTypeDisplayName) { + this.systemTypeDisplayName = Optional.of(systemTypeDisplayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "system_type_display_name", nulls = Nulls.SKIP) + public _FinalStage systemTypeDisplayName(Optional systemTypeDisplayName) { + this.systemTypeDisplayName = systemTypeDisplayName; + return this; + } + + @java.lang.Override + public _FinalStage systemType(AcsSystemSystemType systemType) { + this.systemType = Optional.of(systemType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "system_type", nulls = Nulls.SKIP) + public _FinalStage systemType(Optional systemType) { + this.systemType = systemType; + return this; + } + + @java.lang.Override + public _FinalStage externalTypeDisplayName(String externalTypeDisplayName) { + this.externalTypeDisplayName = Optional.of(externalTypeDisplayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "external_type_display_name", nulls = Nulls.SKIP) + public _FinalStage externalTypeDisplayName(Optional externalTypeDisplayName) { + this.externalTypeDisplayName = externalTypeDisplayName; + return this; + } + + @java.lang.Override + public _FinalStage externalType(AcsSystemExternalType externalType) { + this.externalType = Optional.of(externalType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "external_type", nulls = Nulls.SKIP) + public _FinalStage externalType(Optional externalType) { + this.externalType = externalType; + return this; + } + + @java.lang.Override + public AcsSystem build() { + return new AcsSystem( + acsSystemId, + externalType, + externalTypeDisplayName, + systemType, + systemTypeDisplayName, + name, + createdAt, + workspaceId, + connectedAccountIds, + imageUrl, + imageAltText, + errors, + warnings, + canAutomateEnrollment, + canCreateAcsAccessGroups, + canRemoveAcsUsersFromAcsAccessGroups, + canAddAcsUsersToAcsAccessGroups, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsSystemErrorsItem.java b/src/main/java/com/seam/api/types/AcsSystemErrorsItem.java new file mode 100644 index 0000000..a2d9495 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsSystemErrorsItem.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class AcsSystemErrorsItem { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private AcsSystemErrorsItem(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static AcsSystemErrorsItem seamBridgeDisconnected(AcsSystemErrorsItemSeamBridgeDisconnected value) { + return new AcsSystemErrorsItem(new SeamBridgeDisconnectedValue(value)); + } + + public static AcsSystemErrorsItem visionlineInstanceUnreachable( + AcsSystemErrorsItemVisionlineInstanceUnreachable value) { + return new AcsSystemErrorsItem(new VisionlineInstanceUnreachableValue(value)); + } + + public boolean isSeamBridgeDisconnected() { + return value instanceof SeamBridgeDisconnectedValue; + } + + public boolean isVisionlineInstanceUnreachable() { + return value instanceof VisionlineInstanceUnreachableValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getSeamBridgeDisconnected() { + if (isSeamBridgeDisconnected()) { + return Optional.of(((SeamBridgeDisconnectedValue) value).value); + } + return Optional.empty(); + } + + public Optional getVisionlineInstanceUnreachable() { + if (isVisionlineInstanceUnreachable()) { + return Optional.of(((VisionlineInstanceUnreachableValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitSeamBridgeDisconnected(AcsSystemErrorsItemSeamBridgeDisconnected seamBridgeDisconnected); + + T visitVisionlineInstanceUnreachable( + AcsSystemErrorsItemVisionlineInstanceUnreachable visionlineInstanceUnreachable); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "error_code", + visible = true, + defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(SeamBridgeDisconnectedValue.class), + @JsonSubTypes.Type(VisionlineInstanceUnreachableValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("seam_bridge_disconnected") + private static final class SeamBridgeDisconnectedValue implements Value { + @JsonUnwrapped + private AcsSystemErrorsItemSeamBridgeDisconnected value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private SeamBridgeDisconnectedValue() {} + + private SeamBridgeDisconnectedValue(AcsSystemErrorsItemSeamBridgeDisconnected value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitSeamBridgeDisconnected(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SeamBridgeDisconnectedValue && equalTo((SeamBridgeDisconnectedValue) other); + } + + private boolean equalTo(SeamBridgeDisconnectedValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AcsSystemErrorsItem{" + "value: " + value + "}"; + } + } + + @JsonTypeName("visionline_instance_unreachable") + private static final class VisionlineInstanceUnreachableValue implements Value { + @JsonUnwrapped + private AcsSystemErrorsItemVisionlineInstanceUnreachable value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VisionlineInstanceUnreachableValue() {} + + private VisionlineInstanceUnreachableValue(AcsSystemErrorsItemVisionlineInstanceUnreachable value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVisionlineInstanceUnreachable(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VisionlineInstanceUnreachableValue + && equalTo((VisionlineInstanceUnreachableValue) other); + } + + private boolean equalTo(VisionlineInstanceUnreachableValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AcsSystemErrorsItem{" + "value: " + value + "}"; + } + } + + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "AcsSystemErrorsItem{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsSystemErrorsItemSeamBridgeDisconnected.java b/src/main/java/com/seam/api/types/AcsSystemErrorsItemSeamBridgeDisconnected.java new file mode 100644 index 0000000..7ff88d0 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsSystemErrorsItemSeamBridgeDisconnected.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsSystemErrorsItemSeamBridgeDisconnected.Builder.class) +public final class AcsSystemErrorsItemSeamBridgeDisconnected { + private final OffsetDateTime createdAt; + + private final String message; + + private final Map additionalProperties; + + private AcsSystemErrorsItemSeamBridgeDisconnected( + OffsetDateTime createdAt, String message, Map additionalProperties) { + this.createdAt = createdAt; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsSystemErrorsItemSeamBridgeDisconnected + && equalTo((AcsSystemErrorsItemSeamBridgeDisconnected) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsSystemErrorsItemSeamBridgeDisconnected other) { + return createdAt.equals(other.createdAt) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.createdAt, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CreatedAtStage builder() { + return new Builder(); + } + + public interface CreatedAtStage { + MessageStage createdAt(OffsetDateTime createdAt); + + Builder from(AcsSystemErrorsItemSeamBridgeDisconnected other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + AcsSystemErrorsItemSeamBridgeDisconnected build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CreatedAtStage, MessageStage, _FinalStage { + private OffsetDateTime createdAt; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsSystemErrorsItemSeamBridgeDisconnected other) { + createdAt(other.getCreatedAt()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public MessageStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public AcsSystemErrorsItemSeamBridgeDisconnected build() { + return new AcsSystemErrorsItemSeamBridgeDisconnected(createdAt, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsSystemErrorsItemVisionlineInstanceUnreachable.java b/src/main/java/com/seam/api/types/AcsSystemErrorsItemVisionlineInstanceUnreachable.java new file mode 100644 index 0000000..e779d6a --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsSystemErrorsItemVisionlineInstanceUnreachable.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsSystemErrorsItemVisionlineInstanceUnreachable.Builder.class) +public final class AcsSystemErrorsItemVisionlineInstanceUnreachable { + private final OffsetDateTime createdAt; + + private final String message; + + private final Map additionalProperties; + + private AcsSystemErrorsItemVisionlineInstanceUnreachable( + OffsetDateTime createdAt, String message, Map additionalProperties) { + this.createdAt = createdAt; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsSystemErrorsItemVisionlineInstanceUnreachable + && equalTo((AcsSystemErrorsItemVisionlineInstanceUnreachable) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsSystemErrorsItemVisionlineInstanceUnreachable other) { + return createdAt.equals(other.createdAt) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.createdAt, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CreatedAtStage builder() { + return new Builder(); + } + + public interface CreatedAtStage { + MessageStage createdAt(OffsetDateTime createdAt); + + Builder from(AcsSystemErrorsItemVisionlineInstanceUnreachable other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + AcsSystemErrorsItemVisionlineInstanceUnreachable build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CreatedAtStage, MessageStage, _FinalStage { + private OffsetDateTime createdAt; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsSystemErrorsItemVisionlineInstanceUnreachable other) { + createdAt(other.getCreatedAt()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public MessageStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public AcsSystemErrorsItemVisionlineInstanceUnreachable build() { + return new AcsSystemErrorsItemVisionlineInstanceUnreachable(createdAt, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsSystemExternalType.java b/src/main/java/com/seam/api/types/AcsSystemExternalType.java new file mode 100644 index 0000000..e24d940 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsSystemExternalType.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsSystemExternalType { + PTI_SITE("pti_site"), + + ALTA_ORG("alta_org"), + + SALTO_SITE("salto_site"), + + BRIVO_ACCOUNT("brivo_account"), + + HID_CREDENTIAL_MANAGER_ORGANIZATION("hid_credential_manager_organization"), + + VISIONLINE_SYSTEM("visionline_system"), + + ASSA_ABLOY_CREDENTIAL_SERVICE("assa_abloy_credential_service"), + + LATCH_BUILDING("latch_building"); + + private final String value; + + AcsSystemExternalType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/AcsSystemSystemType.java b/src/main/java/com/seam/api/types/AcsSystemSystemType.java new file mode 100644 index 0000000..9ac142c --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsSystemSystemType.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsSystemSystemType { + PTI_SITE("pti_site"), + + ALTA_ORG("alta_org"), + + SALTO_SITE("salto_site"), + + BRIVO_ACCOUNT("brivo_account"), + + HID_CREDENTIAL_MANAGER_ORGANIZATION("hid_credential_manager_organization"), + + VISIONLINE_SYSTEM("visionline_system"), + + ASSA_ABLOY_CREDENTIAL_SERVICE("assa_abloy_credential_service"), + + LATCH_BUILDING("latch_building"); + + private final String value; + + AcsSystemSystemType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/AcsSystemWarningsItem.java b/src/main/java/com/seam/api/types/AcsSystemWarningsItem.java new file mode 100644 index 0000000..f6c0b94 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsSystemWarningsItem.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsSystemWarningsItem.Builder.class) +public final class AcsSystemWarningsItem { + private final Map additionalProperties; + + private AcsSystemWarningsItem(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsSystemWarningsItem; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AcsSystemWarningsItem other) { + return this; + } + + public AcsSystemWarningsItem build() { + return new AcsSystemWarningsItem(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsUser.java b/src/main/java/com/seam/api/types/AcsUser.java new file mode 100644 index 0000000..9219808 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsUser.java @@ -0,0 +1,630 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsUser.Builder.class) +public final class AcsUser { + private final String acsUserId; + + private final String acsSystemId; + + private final Optional hidAcsSystemId; + + private final String workspaceId; + + private final OffsetDateTime createdAt; + + private final String displayName; + + private final Optional externalType; + + private final Optional externalTypeDisplayName; + + private final boolean isSuspended; + + private final Optional accessSchedule; + + private final Optional userIdentityId; + + private final Optional userIdentityFullName; + + private final Optional userIdentityEmailAddress; + + private final Optional userIdentityPhoneNumber; + + private final Optional fullName; + + private final Optional email; + + private final Optional emailAddress; + + private final Optional phoneNumber; + + private final Map additionalProperties; + + private AcsUser( + String acsUserId, + String acsSystemId, + Optional hidAcsSystemId, + String workspaceId, + OffsetDateTime createdAt, + String displayName, + Optional externalType, + Optional externalTypeDisplayName, + boolean isSuspended, + Optional accessSchedule, + Optional userIdentityId, + Optional userIdentityFullName, + Optional userIdentityEmailAddress, + Optional userIdentityPhoneNumber, + Optional fullName, + Optional email, + Optional emailAddress, + Optional phoneNumber, + Map additionalProperties) { + this.acsUserId = acsUserId; + this.acsSystemId = acsSystemId; + this.hidAcsSystemId = hidAcsSystemId; + this.workspaceId = workspaceId; + this.createdAt = createdAt; + this.displayName = displayName; + this.externalType = externalType; + this.externalTypeDisplayName = externalTypeDisplayName; + this.isSuspended = isSuspended; + this.accessSchedule = accessSchedule; + this.userIdentityId = userIdentityId; + this.userIdentityFullName = userIdentityFullName; + this.userIdentityEmailAddress = userIdentityEmailAddress; + this.userIdentityPhoneNumber = userIdentityPhoneNumber; + this.fullName = fullName; + this.email = email; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("acs_user_id") + public String getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_system_id") + public String getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("hid_acs_system_id") + public Optional getHidAcsSystemId() { + return hidAcsSystemId; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("external_type") + public Optional getExternalType() { + return externalType; + } + + @JsonProperty("external_type_display_name") + public Optional getExternalTypeDisplayName() { + return externalTypeDisplayName; + } + + @JsonProperty("is_suspended") + public boolean getIsSuspended() { + return isSuspended; + } + + @JsonProperty("access_schedule") + public Optional getAccessSchedule() { + return accessSchedule; + } + + @JsonProperty("user_identity_id") + public Optional getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("user_identity_full_name") + public Optional getUserIdentityFullName() { + return userIdentityFullName; + } + + @JsonProperty("user_identity_email_address") + public Optional getUserIdentityEmailAddress() { + return userIdentityEmailAddress; + } + + @JsonProperty("user_identity_phone_number") + public Optional getUserIdentityPhoneNumber() { + return userIdentityPhoneNumber; + } + + @JsonProperty("full_name") + public Optional getFullName() { + return fullName; + } + + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsUser && equalTo((AcsUser) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsUser other) { + return acsUserId.equals(other.acsUserId) + && acsSystemId.equals(other.acsSystemId) + && hidAcsSystemId.equals(other.hidAcsSystemId) + && workspaceId.equals(other.workspaceId) + && createdAt.equals(other.createdAt) + && displayName.equals(other.displayName) + && externalType.equals(other.externalType) + && externalTypeDisplayName.equals(other.externalTypeDisplayName) + && isSuspended == other.isSuspended + && accessSchedule.equals(other.accessSchedule) + && userIdentityId.equals(other.userIdentityId) + && userIdentityFullName.equals(other.userIdentityFullName) + && userIdentityEmailAddress.equals(other.userIdentityEmailAddress) + && userIdentityPhoneNumber.equals(other.userIdentityPhoneNumber) + && fullName.equals(other.fullName) + && email.equals(other.email) + && emailAddress.equals(other.emailAddress) + && phoneNumber.equals(other.phoneNumber); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.acsUserId, + this.acsSystemId, + this.hidAcsSystemId, + this.workspaceId, + this.createdAt, + this.displayName, + this.externalType, + this.externalTypeDisplayName, + this.isSuspended, + this.accessSchedule, + this.userIdentityId, + this.userIdentityFullName, + this.userIdentityEmailAddress, + this.userIdentityPhoneNumber, + this.fullName, + this.email, + this.emailAddress, + this.phoneNumber); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AcsUserIdStage builder() { + return new Builder(); + } + + public interface AcsUserIdStage { + AcsSystemIdStage acsUserId(String acsUserId); + + Builder from(AcsUser other); + } + + public interface AcsSystemIdStage { + WorkspaceIdStage acsSystemId(String acsSystemId); + } + + public interface WorkspaceIdStage { + CreatedAtStage workspaceId(String workspaceId); + } + + public interface CreatedAtStage { + DisplayNameStage createdAt(OffsetDateTime createdAt); + } + + public interface DisplayNameStage { + IsSuspendedStage displayName(String displayName); + } + + public interface IsSuspendedStage { + _FinalStage isSuspended(boolean isSuspended); + } + + public interface _FinalStage { + AcsUser build(); + + _FinalStage hidAcsSystemId(Optional hidAcsSystemId); + + _FinalStage hidAcsSystemId(String hidAcsSystemId); + + _FinalStage externalType(Optional externalType); + + _FinalStage externalType(AcsUserExternalType externalType); + + _FinalStage externalTypeDisplayName(Optional externalTypeDisplayName); + + _FinalStage externalTypeDisplayName(String externalTypeDisplayName); + + _FinalStage accessSchedule(Optional accessSchedule); + + _FinalStage accessSchedule(AcsUserAccessSchedule accessSchedule); + + _FinalStage userIdentityId(Optional userIdentityId); + + _FinalStage userIdentityId(String userIdentityId); + + _FinalStage userIdentityFullName(Optional userIdentityFullName); + + _FinalStage userIdentityFullName(String userIdentityFullName); + + _FinalStage userIdentityEmailAddress(Optional userIdentityEmailAddress); + + _FinalStage userIdentityEmailAddress(String userIdentityEmailAddress); + + _FinalStage userIdentityPhoneNumber(Optional userIdentityPhoneNumber); + + _FinalStage userIdentityPhoneNumber(String userIdentityPhoneNumber); + + _FinalStage fullName(Optional fullName); + + _FinalStage fullName(String fullName); + + _FinalStage email(Optional email); + + _FinalStage email(String email); + + _FinalStage emailAddress(Optional emailAddress); + + _FinalStage emailAddress(String emailAddress); + + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AcsUserIdStage, + AcsSystemIdStage, + WorkspaceIdStage, + CreatedAtStage, + DisplayNameStage, + IsSuspendedStage, + _FinalStage { + private String acsUserId; + + private String acsSystemId; + + private String workspaceId; + + private OffsetDateTime createdAt; + + private String displayName; + + private boolean isSuspended; + + private Optional phoneNumber = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional fullName = Optional.empty(); + + private Optional userIdentityPhoneNumber = Optional.empty(); + + private Optional userIdentityEmailAddress = Optional.empty(); + + private Optional userIdentityFullName = Optional.empty(); + + private Optional userIdentityId = Optional.empty(); + + private Optional accessSchedule = Optional.empty(); + + private Optional externalTypeDisplayName = Optional.empty(); + + private Optional externalType = Optional.empty(); + + private Optional hidAcsSystemId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsUser other) { + acsUserId(other.getAcsUserId()); + acsSystemId(other.getAcsSystemId()); + hidAcsSystemId(other.getHidAcsSystemId()); + workspaceId(other.getWorkspaceId()); + createdAt(other.getCreatedAt()); + displayName(other.getDisplayName()); + externalType(other.getExternalType()); + externalTypeDisplayName(other.getExternalTypeDisplayName()); + isSuspended(other.getIsSuspended()); + accessSchedule(other.getAccessSchedule()); + userIdentityId(other.getUserIdentityId()); + userIdentityFullName(other.getUserIdentityFullName()); + userIdentityEmailAddress(other.getUserIdentityEmailAddress()); + userIdentityPhoneNumber(other.getUserIdentityPhoneNumber()); + fullName(other.getFullName()); + email(other.getEmail()); + emailAddress(other.getEmailAddress()); + phoneNumber(other.getPhoneNumber()); + return this; + } + + @java.lang.Override + @JsonSetter("acs_user_id") + public AcsSystemIdStage acsUserId(String acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + @JsonSetter("acs_system_id") + public WorkspaceIdStage acsSystemId(String acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public CreatedAtStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public DisplayNameStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("display_name") + public IsSuspendedStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + @JsonSetter("is_suspended") + public _FinalStage isSuspended(boolean isSuspended) { + this.isSuspended = isSuspended; + return this; + } + + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.of(phoneNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + @java.lang.Override + public _FinalStage emailAddress(String emailAddress) { + this.emailAddress = Optional.of(emailAddress); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public _FinalStage emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + @java.lang.Override + public _FinalStage email(String email) { + this.email = Optional.of(email); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public _FinalStage email(Optional email) { + this.email = email; + return this; + } + + @java.lang.Override + public _FinalStage fullName(String fullName) { + this.fullName = Optional.of(fullName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "full_name", nulls = Nulls.SKIP) + public _FinalStage fullName(Optional fullName) { + this.fullName = fullName; + return this; + } + + @java.lang.Override + public _FinalStage userIdentityPhoneNumber(String userIdentityPhoneNumber) { + this.userIdentityPhoneNumber = Optional.of(userIdentityPhoneNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_phone_number", nulls = Nulls.SKIP) + public _FinalStage userIdentityPhoneNumber(Optional userIdentityPhoneNumber) { + this.userIdentityPhoneNumber = userIdentityPhoneNumber; + return this; + } + + @java.lang.Override + public _FinalStage userIdentityEmailAddress(String userIdentityEmailAddress) { + this.userIdentityEmailAddress = Optional.of(userIdentityEmailAddress); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_email_address", nulls = Nulls.SKIP) + public _FinalStage userIdentityEmailAddress(Optional userIdentityEmailAddress) { + this.userIdentityEmailAddress = userIdentityEmailAddress; + return this; + } + + @java.lang.Override + public _FinalStage userIdentityFullName(String userIdentityFullName) { + this.userIdentityFullName = Optional.of(userIdentityFullName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_full_name", nulls = Nulls.SKIP) + public _FinalStage userIdentityFullName(Optional userIdentityFullName) { + this.userIdentityFullName = userIdentityFullName; + return this; + } + + @java.lang.Override + public _FinalStage userIdentityId(String userIdentityId) { + this.userIdentityId = Optional.of(userIdentityId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_id", nulls = Nulls.SKIP) + public _FinalStage userIdentityId(Optional userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + public _FinalStage accessSchedule(AcsUserAccessSchedule accessSchedule) { + this.accessSchedule = Optional.of(accessSchedule); + return this; + } + + @java.lang.Override + @JsonSetter(value = "access_schedule", nulls = Nulls.SKIP) + public _FinalStage accessSchedule(Optional accessSchedule) { + this.accessSchedule = accessSchedule; + return this; + } + + @java.lang.Override + public _FinalStage externalTypeDisplayName(String externalTypeDisplayName) { + this.externalTypeDisplayName = Optional.of(externalTypeDisplayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "external_type_display_name", nulls = Nulls.SKIP) + public _FinalStage externalTypeDisplayName(Optional externalTypeDisplayName) { + this.externalTypeDisplayName = externalTypeDisplayName; + return this; + } + + @java.lang.Override + public _FinalStage externalType(AcsUserExternalType externalType) { + this.externalType = Optional.of(externalType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "external_type", nulls = Nulls.SKIP) + public _FinalStage externalType(Optional externalType) { + this.externalType = externalType; + return this; + } + + @java.lang.Override + public _FinalStage hidAcsSystemId(String hidAcsSystemId) { + this.hidAcsSystemId = Optional.of(hidAcsSystemId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hid_acs_system_id", nulls = Nulls.SKIP) + public _FinalStage hidAcsSystemId(Optional hidAcsSystemId) { + this.hidAcsSystemId = hidAcsSystemId; + return this; + } + + @java.lang.Override + public AcsUser build() { + return new AcsUser( + acsUserId, + acsSystemId, + hidAcsSystemId, + workspaceId, + createdAt, + displayName, + externalType, + externalTypeDisplayName, + isSuspended, + accessSchedule, + userIdentityId, + userIdentityFullName, + userIdentityEmailAddress, + userIdentityPhoneNumber, + fullName, + email, + emailAddress, + phoneNumber, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsUserAccessSchedule.java b/src/main/java/com/seam/api/types/AcsUserAccessSchedule.java new file mode 100644 index 0000000..6ca8385 --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsUserAccessSchedule.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = AcsUserAccessSchedule.Builder.class) +public final class AcsUserAccessSchedule { + private final OffsetDateTime startsAt; + + private final OffsetDateTime endsAt; + + private final Map additionalProperties; + + private AcsUserAccessSchedule( + OffsetDateTime startsAt, OffsetDateTime endsAt, Map additionalProperties) { + this.startsAt = startsAt; + this.endsAt = endsAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("starts_at") + public OffsetDateTime getStartsAt() { + return startsAt; + } + + @JsonProperty("ends_at") + public OffsetDateTime getEndsAt() { + return endsAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AcsUserAccessSchedule && equalTo((AcsUserAccessSchedule) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AcsUserAccessSchedule other) { + return startsAt.equals(other.startsAt) && endsAt.equals(other.endsAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.startsAt, this.endsAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StartsAtStage builder() { + return new Builder(); + } + + public interface StartsAtStage { + EndsAtStage startsAt(OffsetDateTime startsAt); + + Builder from(AcsUserAccessSchedule other); + } + + public interface EndsAtStage { + _FinalStage endsAt(OffsetDateTime endsAt); + } + + public interface _FinalStage { + AcsUserAccessSchedule build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StartsAtStage, EndsAtStage, _FinalStage { + private OffsetDateTime startsAt; + + private OffsetDateTime endsAt; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AcsUserAccessSchedule other) { + startsAt(other.getStartsAt()); + endsAt(other.getEndsAt()); + return this; + } + + @java.lang.Override + @JsonSetter("starts_at") + public EndsAtStage startsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + return this; + } + + @java.lang.Override + @JsonSetter("ends_at") + public _FinalStage endsAt(OffsetDateTime endsAt) { + this.endsAt = endsAt; + return this; + } + + @java.lang.Override + public AcsUserAccessSchedule build() { + return new AcsUserAccessSchedule(startsAt, endsAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AcsUserExternalType.java b/src/main/java/com/seam/api/types/AcsUserExternalType.java new file mode 100644 index 0000000..1b231fd --- /dev/null +++ b/src/main/java/com/seam/api/types/AcsUserExternalType.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AcsUserExternalType { + PTI_USER("pti_user"), + + BRIVO_USER("brivo_user"), + + HID_CREDENTIAL_MANAGER_USER("hid_credential_manager_user"), + + SALTO_SITE_USER("salto_site_user"), + + LATCH_USER("latch_user"); + + private final String value; + + AcsUserExternalType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttempt.java b/src/main/java/com/seam/api/types/ActionAttempt.java index 1a8dd59..bea8acb 100644 --- a/src/main/java/com/seam/api/types/ActionAttempt.java +++ b/src/main/java/com/seam/api/types/ActionAttempt.java @@ -3,257 +3,608 @@ */ package com.seam.api.types; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; import java.util.Objects; -import java.util.Optional; +@JsonDeserialize(using = ActionAttempt.Deserializer.class) public final class ActionAttempt { - private final Value value; + private final Object value; - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private ActionAttempt(Value value) { + private final int type; + + private ActionAttempt(Object value, int type) { this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; } public T visit(Visitor visitor) { - return value.visit(visitor); + if (this.type == 0) { + return visitor.visit((ActionAttemptZero) this.value); + } else if (this.type == 1) { + return visitor.visit((ActionAttemptOne) this.value); + } else if (this.type == 2) { + return visitor.visit((ActionAttemptTwo) this.value); + } else if (this.type == 3) { + return visitor.visit((ActionAttemptThree) this.value); + } else if (this.type == 4) { + return visitor.visit((ActionAttemptFour) this.value); + } else if (this.type == 5) { + return visitor.visit((ActionAttemptFive) this.value); + } else if (this.type == 6) { + return visitor.visit((ActionAttemptSix) this.value); + } else if (this.type == 7) { + return visitor.visit((ActionAttemptSeven) this.value); + } else if (this.type == 8) { + return visitor.visit((ActionAttemptEight) this.value); + } else if (this.type == 9) { + return visitor.visit((ActionAttemptNine) this.value); + } else if (this.type == 10) { + return visitor.visit((ActionAttemptTen) this.value); + } else if (this.type == 11) { + return visitor.visit((ActionAttemptEleven) this.value); + } else if (this.type == 12) { + return visitor.visit((ActionAttemptTwelve) this.value); + } else if (this.type == 13) { + return visitor.visit((ActionAttemptThirteen) this.value); + } else if (this.type == 14) { + return visitor.visit((ActionAttemptFourteen) this.value); + } else if (this.type == 15) { + return visitor.visit((ActionAttemptFifteen) this.value); + } else if (this.type == 16) { + return visitor.visit((ActionAttemptSixteen) this.value); + } else if (this.type == 17) { + return visitor.visit((ActionAttemptSeventeen) this.value); + } else if (this.type == 18) { + return visitor.visit((ActionAttemptEighteen) this.value); + } else if (this.type == 19) { + return visitor.visit((ActionAttemptNineteen) this.value); + } else if (this.type == 20) { + return visitor.visit((ActionAttemptTwenty) this.value); + } else if (this.type == 21) { + return visitor.visit((ActionAttemptTwentyOne) this.value); + } else if (this.type == 22) { + return visitor.visit((ActionAttemptTwentyTwo) this.value); + } else if (this.type == 23) { + return visitor.visit((ActionAttemptTwentyThree) this.value); + } else if (this.type == 24) { + return visitor.visit((ActionAttemptTwentyFour) this.value); + } else if (this.type == 25) { + return visitor.visit((ActionAttemptTwentyFive) this.value); + } else if (this.type == 26) { + return visitor.visit((ActionAttemptTwentySix) this.value); + } else if (this.type == 27) { + return visitor.visit((ActionAttemptTwentySeven) this.value); + } else if (this.type == 28) { + return visitor.visit((ActionAttemptTwentyEight) this.value); + } else if (this.type == 29) { + return visitor.visit((ActionAttemptTwentyNine) this.value); + } else if (this.type == 30) { + return visitor.visit((ActionAttemptThirty) this.value); + } else if (this.type == 31) { + return visitor.visit((ActionAttemptThirtyOne) this.value); + } else if (this.type == 32) { + return visitor.visit((ActionAttemptThirtyTwo) this.value); + } else if (this.type == 33) { + return visitor.visit((ActionAttemptThirtyThree) this.value); + } else if (this.type == 34) { + return visitor.visit((ActionAttemptThirtyFour) this.value); + } else if (this.type == 35) { + return visitor.visit((ActionAttemptThirtyFive) this.value); + } else if (this.type == 36) { + return visitor.visit((ActionAttemptThirtySix) this.value); + } else if (this.type == 37) { + return visitor.visit((ActionAttemptThirtySeven) this.value); + } else if (this.type == 38) { + return visitor.visit((ActionAttemptThirtyEight) this.value); + } else if (this.type == 39) { + return visitor.visit((ActionAttemptThirtyNine) this.value); + } else if (this.type == 40) { + return visitor.visit((ActionAttemptForty) this.value); + } else if (this.type == 41) { + return visitor.visit((ActionAttemptFortyOne) this.value); + } else if (this.type == 42) { + return visitor.visit((ActionAttemptFortyTwo) this.value); + } else if (this.type == 43) { + return visitor.visit((ActionAttemptFortyThree) this.value); + } else if (this.type == 44) { + return visitor.visit((ActionAttemptActionAttemptId) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); } - public static ActionAttempt success(ActionAttemptSuccess value) { - return new ActionAttempt(new SuccessValue(value)); + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttempt && equalTo((ActionAttempt) other); } - public static ActionAttempt pending(ActionAttemptPending value) { - return new ActionAttempt(new PendingValue(value)); + private boolean equalTo(ActionAttempt other) { + return value.equals(other.value); } - public static ActionAttempt error(ActionAttemptError value) { - return new ActionAttempt(new ErrorValue(value)); + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); } - public boolean isSuccess() { - return value instanceof SuccessValue; + @java.lang.Override + public String toString() { + return this.value.toString(); } - public boolean isPending() { - return value instanceof PendingValue; + public static ActionAttempt of(ActionAttemptZero value) { + return new ActionAttempt(value, 0); } - public boolean isError() { - return value instanceof ErrorValue; + public static ActionAttempt of(ActionAttemptOne value) { + return new ActionAttempt(value, 1); } - public boolean _isUnknown() { - return value instanceof _UnknownValue; + public static ActionAttempt of(ActionAttemptTwo value) { + return new ActionAttempt(value, 2); } - public Optional getSuccess() { - if (isSuccess()) { - return Optional.of(((SuccessValue) value).value); - } - return Optional.empty(); + public static ActionAttempt of(ActionAttemptThree value) { + return new ActionAttempt(value, 3); } - public Optional getPending() { - if (isPending()) { - return Optional.of(((PendingValue) value).value); - } - return Optional.empty(); + public static ActionAttempt of(ActionAttemptFour value) { + return new ActionAttempt(value, 4); } - public Optional getError() { - if (isError()) { - return Optional.of(((ErrorValue) value).value); - } - return Optional.empty(); + public static ActionAttempt of(ActionAttemptFive value) { + return new ActionAttempt(value, 5); } - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); + public static ActionAttempt of(ActionAttemptSix value) { + return new ActionAttempt(value, 6); } - @JsonValue - private Value getValue() { - return this.value; + public static ActionAttempt of(ActionAttemptSeven value) { + return new ActionAttempt(value, 7); } - public interface Visitor { - T visitSuccess(ActionAttemptSuccess success); + public static ActionAttempt of(ActionAttemptEight value) { + return new ActionAttempt(value, 8); + } - T visitPending(ActionAttemptPending pending); + public static ActionAttempt of(ActionAttemptNine value) { + return new ActionAttempt(value, 9); + } - T visitError(ActionAttemptError error); + public static ActionAttempt of(ActionAttemptTen value) { + return new ActionAttempt(value, 10); + } - T _visitUnknown(Object unknownType); + public static ActionAttempt of(ActionAttemptEleven value) { + return new ActionAttempt(value, 11); } - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "status", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({ - @JsonSubTypes.Type(SuccessValue.class), - @JsonSubTypes.Type(PendingValue.class), - @JsonSubTypes.Type(ErrorValue.class) - }) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); + public static ActionAttempt of(ActionAttemptTwelve value) { + return new ActionAttempt(value, 12); } - @JsonTypeName("success") - private static final class SuccessValue implements Value { - @JsonUnwrapped - private ActionAttemptSuccess value; + public static ActionAttempt of(ActionAttemptThirteen value) { + return new ActionAttempt(value, 13); + } - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private SuccessValue() {} + public static ActionAttempt of(ActionAttemptFourteen value) { + return new ActionAttempt(value, 14); + } - private SuccessValue(ActionAttemptSuccess value) { - this.value = value; - } + public static ActionAttempt of(ActionAttemptFifteen value) { + return new ActionAttempt(value, 15); + } - @Override - public T visit(Visitor visitor) { - return visitor.visitSuccess(value); - } + public static ActionAttempt of(ActionAttemptSixteen value) { + return new ActionAttempt(value, 16); + } - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SuccessValue && equalTo((SuccessValue) other); - } + public static ActionAttempt of(ActionAttemptSeventeen value) { + return new ActionAttempt(value, 17); + } - private boolean equalTo(SuccessValue other) { - return value.equals(other.value); - } + public static ActionAttempt of(ActionAttemptEighteen value) { + return new ActionAttempt(value, 18); + } - @Override - public int hashCode() { - return Objects.hash(this.value); - } + public static ActionAttempt of(ActionAttemptNineteen value) { + return new ActionAttempt(value, 19); + } - @Override - public String toString() { - return "ActionAttempt{" + "value: " + value + "}"; - } + public static ActionAttempt of(ActionAttemptTwenty value) { + return new ActionAttempt(value, 20); } - @JsonTypeName("pending") - private static final class PendingValue implements Value { - @JsonUnwrapped - private ActionAttemptPending value; + public static ActionAttempt of(ActionAttemptTwentyOne value) { + return new ActionAttempt(value, 21); + } - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private PendingValue() {} + public static ActionAttempt of(ActionAttemptTwentyTwo value) { + return new ActionAttempt(value, 22); + } - private PendingValue(ActionAttemptPending value) { - this.value = value; - } + public static ActionAttempt of(ActionAttemptTwentyThree value) { + return new ActionAttempt(value, 23); + } - @Override - public T visit(Visitor visitor) { - return visitor.visitPending(value); - } + public static ActionAttempt of(ActionAttemptTwentyFour value) { + return new ActionAttempt(value, 24); + } - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PendingValue && equalTo((PendingValue) other); - } + public static ActionAttempt of(ActionAttemptTwentyFive value) { + return new ActionAttempt(value, 25); + } - private boolean equalTo(PendingValue other) { - return value.equals(other.value); - } + public static ActionAttempt of(ActionAttemptTwentySix value) { + return new ActionAttempt(value, 26); + } - @Override - public int hashCode() { - return Objects.hash(this.value); - } + public static ActionAttempt of(ActionAttemptTwentySeven value) { + return new ActionAttempt(value, 27); + } - @Override - public String toString() { - return "ActionAttempt{" + "value: " + value + "}"; - } + public static ActionAttempt of(ActionAttemptTwentyEight value) { + return new ActionAttempt(value, 28); } - @JsonTypeName("error") - private static final class ErrorValue implements Value { - @JsonUnwrapped - private ActionAttemptError value; + public static ActionAttempt of(ActionAttemptTwentyNine value) { + return new ActionAttempt(value, 29); + } - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private ErrorValue() {} + public static ActionAttempt of(ActionAttemptThirty value) { + return new ActionAttempt(value, 30); + } - private ErrorValue(ActionAttemptError value) { - this.value = value; - } + public static ActionAttempt of(ActionAttemptThirtyOne value) { + return new ActionAttempt(value, 31); + } - @Override - public T visit(Visitor visitor) { - return visitor.visitError(value); - } + public static ActionAttempt of(ActionAttemptThirtyTwo value) { + return new ActionAttempt(value, 32); + } - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorValue && equalTo((ErrorValue) other); - } + public static ActionAttempt of(ActionAttemptThirtyThree value) { + return new ActionAttempt(value, 33); + } - private boolean equalTo(ErrorValue other) { - return value.equals(other.value); - } + public static ActionAttempt of(ActionAttemptThirtyFour value) { + return new ActionAttempt(value, 34); + } - @Override - public int hashCode() { - return Objects.hash(this.value); - } + public static ActionAttempt of(ActionAttemptThirtyFive value) { + return new ActionAttempt(value, 35); + } - @Override - public String toString() { - return "ActionAttempt{" + "value: " + value + "}"; - } + public static ActionAttempt of(ActionAttemptThirtySix value) { + return new ActionAttempt(value, 36); } - private static final class _UnknownValue implements Value { - private String type; + public static ActionAttempt of(ActionAttemptThirtySeven value) { + return new ActionAttempt(value, 37); + } - @JsonValue - private Object value; + public static ActionAttempt of(ActionAttemptThirtyEight value) { + return new ActionAttempt(value, 38); + } - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} + public static ActionAttempt of(ActionAttemptThirtyNine value) { + return new ActionAttempt(value, 39); + } - @Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } + public static ActionAttempt of(ActionAttemptForty value) { + return new ActionAttempt(value, 40); + } - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } + public static ActionAttempt of(ActionAttemptFortyOne value) { + return new ActionAttempt(value, 41); + } - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } + public static ActionAttempt of(ActionAttemptFortyTwo value) { + return new ActionAttempt(value, 42); + } + + public static ActionAttempt of(ActionAttemptFortyThree value) { + return new ActionAttempt(value, 43); + } + + public static ActionAttempt of(ActionAttemptActionAttemptId value) { + return new ActionAttempt(value, 44); + } + + public interface Visitor { + T visit(ActionAttemptZero value); + + T visit(ActionAttemptOne value); + + T visit(ActionAttemptTwo value); + + T visit(ActionAttemptThree value); + + T visit(ActionAttemptFour value); + + T visit(ActionAttemptFive value); + + T visit(ActionAttemptSix value); + + T visit(ActionAttemptSeven value); + + T visit(ActionAttemptEight value); + + T visit(ActionAttemptNine value); + + T visit(ActionAttemptTen value); + + T visit(ActionAttemptEleven value); + + T visit(ActionAttemptTwelve value); + + T visit(ActionAttemptThirteen value); + + T visit(ActionAttemptFourteen value); + + T visit(ActionAttemptFifteen value); + + T visit(ActionAttemptSixteen value); + + T visit(ActionAttemptSeventeen value); + + T visit(ActionAttemptEighteen value); + + T visit(ActionAttemptNineteen value); + + T visit(ActionAttemptTwenty value); + + T visit(ActionAttemptTwentyOne value); + + T visit(ActionAttemptTwentyTwo value); + + T visit(ActionAttemptTwentyThree value); + + T visit(ActionAttemptTwentyFour value); + + T visit(ActionAttemptTwentyFive value); + + T visit(ActionAttemptTwentySix value); + + T visit(ActionAttemptTwentySeven value); + + T visit(ActionAttemptTwentyEight value); + + T visit(ActionAttemptTwentyNine value); + + T visit(ActionAttemptThirty value); + + T visit(ActionAttemptThirtyOne value); + + T visit(ActionAttemptThirtyTwo value); + + T visit(ActionAttemptThirtyThree value); + + T visit(ActionAttemptThirtyFour value); + + T visit(ActionAttemptThirtyFive value); + + T visit(ActionAttemptThirtySix value); + + T visit(ActionAttemptThirtySeven value); + + T visit(ActionAttemptThirtyEight value); + + T visit(ActionAttemptThirtyNine value); + + T visit(ActionAttemptForty value); + + T visit(ActionAttemptFortyOne value); + + T visit(ActionAttemptFortyTwo value); + + T visit(ActionAttemptFortyThree value); + + T visit(ActionAttemptActionAttemptId value); + } - @Override - public int hashCode() { - return Objects.hash(this.type, this.value); + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ActionAttempt.class); } - @Override - public String toString() { - return "ActionAttempt{" + "type: " + type + ", value: " + value + "}"; + @java.lang.Override + public ActionAttempt deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptZero.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptOne.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwo.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThree.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptFour.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptFive.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptSix.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptSeven.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptEight.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptNine.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptEleven.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwelve.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirteen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptFourteen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptFifteen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptSixteen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptSeventeen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptEighteen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptNineteen.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwenty.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentyOne.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentyTwo.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentyThree.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentyFour.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentyFive.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentySix.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentySeven.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentyEight.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptTwentyNine.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirty.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtyOne.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtyTwo.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtyThree.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtyFour.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtyFive.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtySix.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtySeven.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtyEight.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptThirtyNine.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptForty.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptFortyOne.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptFortyTwo.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptFortyThree.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActionAttemptActionAttemptId.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); } } } diff --git a/src/main/java/com/seam/api/types/ActionAttemptActionAttemptId.java b/src/main/java/com/seam/api/types/ActionAttemptActionAttemptId.java new file mode 100644 index 0000000..f37ed17 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptActionAttemptId.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptActionAttemptId.Builder.class) +public final class ActionAttemptActionAttemptId { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptActionAttemptIdError error; + + private final Map additionalProperties; + + private ActionAttemptActionAttemptId( + String actionAttemptId, + Object result, + ActionAttemptActionAttemptIdError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UPDATE_NOISE_THRESHOLD"; + } + + @JsonProperty("error") + public ActionAttemptActionAttemptIdError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptActionAttemptId && equalTo((ActionAttemptActionAttemptId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptActionAttemptId other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptActionAttemptId other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptActionAttemptIdError error); + } + + public interface _FinalStage { + ActionAttemptActionAttemptId build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptActionAttemptIdError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptActionAttemptId other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptActionAttemptIdError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptActionAttemptId build() { + return new ActionAttemptActionAttemptId(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptActionAttemptIdError.java b/src/main/java/com/seam/api/types/ActionAttemptActionAttemptIdError.java new file mode 100644 index 0000000..3c08db2 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptActionAttemptIdError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptActionAttemptIdError.Builder.class) +public final class ActionAttemptActionAttemptIdError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptActionAttemptIdError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptActionAttemptIdError && equalTo((ActionAttemptActionAttemptIdError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptActionAttemptIdError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptActionAttemptIdError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptActionAttemptIdError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptActionAttemptIdError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptActionAttemptIdError build() { + return new ActionAttemptActionAttemptIdError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptEight.java b/src/main/java/com/seam/api/types/ActionAttemptEight.java new file mode 100644 index 0000000..85b7e9a --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptEight.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptEight.Builder.class) +public final class ActionAttemptEight { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptEightError error; + + private final Map additionalProperties; + + private ActionAttemptEight( + String actionAttemptId, + Object result, + ActionAttemptEightError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "RESET_SANDBOX_WORKSPACE"; + } + + @JsonProperty("error") + public ActionAttemptEightError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptEight && equalTo((ActionAttemptEight) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptEight other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptEight other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptEightError error); + } + + public interface _FinalStage { + ActionAttemptEight build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptEightError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptEight other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptEightError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptEight build() { + return new ActionAttemptEight(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptErrorError.java b/src/main/java/com/seam/api/types/ActionAttemptEightError.java similarity index 77% rename from src/main/java/com/seam/api/types/ActionAttemptErrorError.java rename to src/main/java/com/seam/api/types/ActionAttemptEightError.java index f142bd5..619cb12 100644 --- a/src/main/java/com/seam/api/types/ActionAttemptErrorError.java +++ b/src/main/java/com/seam/api/types/ActionAttemptEightError.java @@ -16,15 +16,15 @@ import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ActionAttemptErrorError.Builder.class) -public final class ActionAttemptErrorError { +@JsonDeserialize(builder = ActionAttemptEightError.Builder.class) +public final class ActionAttemptEightError { private final String type; private final String message; private final Map additionalProperties; - private ActionAttemptErrorError(String type, String message, Map additionalProperties) { + private ActionAttemptEightError(String type, String message, Map additionalProperties) { this.type = type; this.message = message; this.additionalProperties = additionalProperties; @@ -40,10 +40,10 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ActionAttemptErrorError && equalTo((ActionAttemptErrorError) other); + return other instanceof ActionAttemptEightError && equalTo((ActionAttemptEightError) other); } @JsonAnyGetter @@ -51,16 +51,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ActionAttemptErrorError other) { + private boolean equalTo(ActionAttemptEightError other) { return type.equals(other.type) && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -72,7 +72,7 @@ public static TypeStage builder() { public interface TypeStage { MessageStage type(String type); - Builder from(ActionAttemptErrorError other); + Builder from(ActionAttemptEightError other); } public interface MessageStage { @@ -80,7 +80,7 @@ public interface MessageStage { } public interface _FinalStage { - ActionAttemptErrorError build(); + ActionAttemptEightError build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -94,30 +94,30 @@ public static final class Builder implements TypeStage, MessageStage, _FinalStag private Builder() {} - @Override - public Builder from(ActionAttemptErrorError other) { + @java.lang.Override + public Builder from(ActionAttemptEightError other) { type(other.getType()); message(other.getMessage()); return this; } - @Override + @java.lang.Override @JsonSetter("type") public MessageStage type(String type) { this.type = type; return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(String message) { this.message = message; return this; } - @Override - public ActionAttemptErrorError build() { - return new ActionAttemptErrorError(type, message, additionalProperties); + @java.lang.Override + public ActionAttemptEightError build() { + return new ActionAttemptEightError(type, message, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/ActionAttemptEighteen.java b/src/main/java/com/seam/api/types/ActionAttemptEighteen.java new file mode 100644 index 0000000..8d0aa3a --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptEighteen.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptEighteen.Builder.class) +public final class ActionAttemptEighteen { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptEighteen( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_FAN_MODE"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptEighteen && equalTo((ActionAttemptEighteen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptEighteen other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptEighteen other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptEighteen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptEighteen other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptEighteen build() { + return new ActionAttemptEighteen(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptEleven.java b/src/main/java/com/seam/api/types/ActionAttemptEleven.java new file mode 100644 index 0000000..011d3a6 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptEleven.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptEleven.Builder.class) +public final class ActionAttemptEleven { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptElevenError error; + + private final Map additionalProperties; + + private ActionAttemptEleven( + String actionAttemptId, + Object result, + ActionAttemptElevenError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_COOL"; + } + + @JsonProperty("error") + public ActionAttemptElevenError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptEleven && equalTo((ActionAttemptEleven) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptEleven other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptEleven other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptElevenError error); + } + + public interface _FinalStage { + ActionAttemptEleven build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptElevenError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptEleven other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptElevenError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptEleven build() { + return new ActionAttemptEleven(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptElevenError.java b/src/main/java/com/seam/api/types/ActionAttemptElevenError.java new file mode 100644 index 0000000..19a15a1 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptElevenError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptElevenError.Builder.class) +public final class ActionAttemptElevenError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptElevenError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptElevenError && equalTo((ActionAttemptElevenError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptElevenError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptElevenError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptElevenError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptElevenError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptElevenError build() { + return new ActionAttemptElevenError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFifteen.java b/src/main/java/com/seam/api/types/ActionAttemptFifteen.java new file mode 100644 index 0000000..d653856 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFifteen.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFifteen.Builder.class) +public final class ActionAttemptFifteen { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptFifteen( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_HEAT_COOL"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFifteen && equalTo((ActionAttemptFifteen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFifteen other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptFifteen other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptFifteen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFifteen other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptFifteen build() { + return new ActionAttemptFifteen(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFive.java b/src/main/java/com/seam/api/types/ActionAttemptFive.java new file mode 100644 index 0000000..0ef468d --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFive.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFive.Builder.class) +public final class ActionAttemptFive { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptFiveError error; + + private final Map additionalProperties; + + private ActionAttemptFive( + String actionAttemptId, + Object result, + ActionAttemptFiveError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UNLOCK_DOOR"; + } + + @JsonProperty("error") + public ActionAttemptFiveError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFive && equalTo((ActionAttemptFive) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFive other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptFive other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptFiveError error); + } + + public interface _FinalStage { + ActionAttemptFive build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptFiveError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFive other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptFiveError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptFive build() { + return new ActionAttemptFive(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFiveError.java b/src/main/java/com/seam/api/types/ActionAttemptFiveError.java new file mode 100644 index 0000000..59a28c5 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFiveError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFiveError.Builder.class) +public final class ActionAttemptFiveError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptFiveError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFiveError && equalTo((ActionAttemptFiveError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFiveError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptFiveError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptFiveError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFiveError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptFiveError build() { + return new ActionAttemptFiveError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptError.java b/src/main/java/com/seam/api/types/ActionAttemptForty.java similarity index 53% rename from src/main/java/com/seam/api/types/ActionAttemptError.java rename to src/main/java/com/seam/api/types/ActionAttemptForty.java index da3eb50..992cca4 100644 --- a/src/main/java/com/seam/api/types/ActionAttemptError.java +++ b/src/main/java/com/seam/api/types/ActionAttemptForty.java @@ -18,55 +18,56 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ActionAttemptError.Builder.class) -public final class ActionAttemptError { - private final String actionType; - +@JsonDeserialize(builder = ActionAttemptForty.Builder.class) +public final class ActionAttemptForty { private final String actionAttemptId; - private final Optional result; + private final Object error; - private final ActionAttemptErrorError error; + private final Optional result; private final Map additionalProperties; - private ActionAttemptError( - String actionType, - String actionAttemptId, - Optional result, - ActionAttemptErrorError error, - Map additionalProperties) { - this.actionType = actionType; + private ActionAttemptForty( + String actionAttemptId, Object error, Optional result, Map additionalProperties) { this.actionAttemptId = actionAttemptId; - this.result = result; this.error = error; + this.result = result; this.additionalProperties = additionalProperties; } - @JsonProperty("action_type") - public String getActionType() { - return actionType; - } - + /** + * @return The ID of the action attempt. + */ @JsonProperty("action_attempt_id") public String getActionAttemptId() { return actionAttemptId; } - @JsonProperty("result") - public Optional getResult() { - return result; + @JsonProperty("status") + public String getStatus() { + return "success"; } @JsonProperty("error") - public ActionAttemptErrorError getError() { + public Object getError() { return error; } - @Override + @JsonProperty("action_type") + public String getActionType() { + return "DELETE_NOISE_THRESHOLD"; + } + + @JsonProperty("result") + public Optional getResult() { + return result; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ActionAttemptError && equalTo((ActionAttemptError) other); + return other instanceof ActionAttemptForty && equalTo((ActionAttemptForty) other); } @JsonAnyGetter @@ -74,110 +75,99 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ActionAttemptError other) { - return actionType.equals(other.actionType) - && actionAttemptId.equals(other.actionAttemptId) - && result.equals(other.result) - && error.equals(other.error); + private boolean equalTo(ActionAttemptForty other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.actionType, this.actionAttemptId, this.result, this.error); + return Objects.hash(this.actionAttemptId, this.error, this.result); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } - public static ActionTypeStage builder() { + public static ActionAttemptIdStage builder() { return new Builder(); } - public interface ActionTypeStage { - ActionAttemptIdStage actionType(String actionType); - - Builder from(ActionAttemptError other); - } - public interface ActionAttemptIdStage { ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptForty other); } public interface ErrorStage { - _FinalStage error(ActionAttemptErrorError error); + _FinalStage error(Object error); } public interface _FinalStage { - ActionAttemptError build(); + ActionAttemptForty build(); - _FinalStage result(Optional result); + _FinalStage result(Optional result); - _FinalStage result(String result); + _FinalStage result(Object result); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ActionTypeStage, ActionAttemptIdStage, ErrorStage, _FinalStage { - private String actionType; - + public static final class Builder implements ActionAttemptIdStage, ErrorStage, _FinalStage { private String actionAttemptId; - private ActionAttemptErrorError error; + private Object error; - private Optional result = Optional.empty(); + private Optional result = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override - public Builder from(ActionAttemptError other) { - actionType(other.getActionType()); + @java.lang.Override + public Builder from(ActionAttemptForty other) { actionAttemptId(other.getActionAttemptId()); - result(other.getResult()); error(other.getError()); + result(other.getResult()); return this; } - @Override - @JsonSetter("action_type") - public ActionAttemptIdStage actionType(String actionType) { - this.actionType = actionType; - return this; - } - - @Override + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("action_attempt_id") public ErrorStage actionAttemptId(String actionAttemptId) { this.actionAttemptId = actionAttemptId; return this; } - @Override + @java.lang.Override @JsonSetter("error") - public _FinalStage error(ActionAttemptErrorError error) { + public _FinalStage error(Object error) { this.error = error; return this; } - @Override - public _FinalStage result(String result) { + @java.lang.Override + public _FinalStage result(Object result) { this.result = Optional.of(result); return this; } - @Override + @java.lang.Override @JsonSetter(value = "result", nulls = Nulls.SKIP) - public _FinalStage result(Optional result) { + public _FinalStage result(Optional result) { this.result = result; return this; } - @Override - public ActionAttemptError build() { - return new ActionAttemptError(actionType, actionAttemptId, result, error, additionalProperties); + @java.lang.Override + public ActionAttemptForty build() { + return new ActionAttemptForty(actionAttemptId, error, result, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/ActionAttemptFortyOne.java b/src/main/java/com/seam/api/types/ActionAttemptFortyOne.java new file mode 100644 index 0000000..aca4c14 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFortyOne.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFortyOne.Builder.class) +public final class ActionAttemptFortyOne { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptFortyOneError error; + + private final Map additionalProperties; + + private ActionAttemptFortyOne( + String actionAttemptId, + Object result, + ActionAttemptFortyOneError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "DELETE_NOISE_THRESHOLD"; + } + + @JsonProperty("error") + public ActionAttemptFortyOneError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFortyOne && equalTo((ActionAttemptFortyOne) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFortyOne other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptFortyOne other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptFortyOneError error); + } + + public interface _FinalStage { + ActionAttemptFortyOne build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptFortyOneError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFortyOne other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptFortyOneError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptFortyOne build() { + return new ActionAttemptFortyOne(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFortyOneError.java b/src/main/java/com/seam/api/types/ActionAttemptFortyOneError.java new file mode 100644 index 0000000..72c4094 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFortyOneError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFortyOneError.Builder.class) +public final class ActionAttemptFortyOneError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptFortyOneError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFortyOneError && equalTo((ActionAttemptFortyOneError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFortyOneError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptFortyOneError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptFortyOneError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFortyOneError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptFortyOneError build() { + return new ActionAttemptFortyOneError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFortyThree.java b/src/main/java/com/seam/api/types/ActionAttemptFortyThree.java new file mode 100644 index 0000000..9aea232 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFortyThree.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFortyThree.Builder.class) +public final class ActionAttemptFortyThree { + private final String actionAttemptId; + + private final Object error; + + private final Optional result; + + private final Map additionalProperties; + + private ActionAttemptFortyThree( + String actionAttemptId, Object error, Optional result, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UPDATE_NOISE_THRESHOLD"; + } + + @JsonProperty("result") + public Optional getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFortyThree && equalTo((ActionAttemptFortyThree) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFortyThree other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptFortyThree other); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptFortyThree build(); + + _FinalStage result(Optional result); + + _FinalStage result(Object result); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private Optional result = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFortyThree other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public _FinalStage result(Object result) { + this.result = Optional.of(result); + return this; + } + + @java.lang.Override + @JsonSetter(value = "result", nulls = Nulls.SKIP) + public _FinalStage result(Optional result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptFortyThree build() { + return new ActionAttemptFortyThree(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFortyTwo.java b/src/main/java/com/seam/api/types/ActionAttemptFortyTwo.java new file mode 100644 index 0000000..d24374c --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFortyTwo.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFortyTwo.Builder.class) +public final class ActionAttemptFortyTwo { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptFortyTwo( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UPDATE_NOISE_THRESHOLD"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFortyTwo && equalTo((ActionAttemptFortyTwo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFortyTwo other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptFortyTwo other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptFortyTwo build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFortyTwo other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptFortyTwo build() { + return new ActionAttemptFortyTwo(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFour.java b/src/main/java/com/seam/api/types/ActionAttemptFour.java new file mode 100644 index 0000000..4beb22d --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFour.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFour.Builder.class) +public final class ActionAttemptFour { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptFourResult result; + + private final Map additionalProperties; + + private ActionAttemptFour( + String actionAttemptId, + Object error, + ActionAttemptFourResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UNLOCK_DOOR"; + } + + @JsonProperty("result") + public ActionAttemptFourResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFour && equalTo((ActionAttemptFour) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFour other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptFour other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptFourResult result); + } + + public interface _FinalStage { + ActionAttemptFour build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptFourResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFour other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptFourResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptFour build() { + return new ActionAttemptFour(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFourResult.java b/src/main/java/com/seam/api/types/ActionAttemptFourResult.java new file mode 100644 index 0000000..f391b31 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFourResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFourResult.Builder.class) +public final class ActionAttemptFourResult { + private final Map additionalProperties; + + private ActionAttemptFourResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFourResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptFourResult other) { + return this; + } + + public ActionAttemptFourResult build() { + return new ActionAttemptFourResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFourteen.java b/src/main/java/com/seam/api/types/ActionAttemptFourteen.java new file mode 100644 index 0000000..1774c5a --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFourteen.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFourteen.Builder.class) +public final class ActionAttemptFourteen { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptFourteenError error; + + private final Map additionalProperties; + + private ActionAttemptFourteen( + String actionAttemptId, + Object result, + ActionAttemptFourteenError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_HEAT"; + } + + @JsonProperty("error") + public ActionAttemptFourteenError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFourteen && equalTo((ActionAttemptFourteen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFourteen other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptFourteen other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptFourteenError error); + } + + public interface _FinalStage { + ActionAttemptFourteen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptFourteenError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFourteen other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptFourteenError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptFourteen build() { + return new ActionAttemptFourteen(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptFourteenError.java b/src/main/java/com/seam/api/types/ActionAttemptFourteenError.java new file mode 100644 index 0000000..5120b06 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptFourteenError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptFourteenError.Builder.class) +public final class ActionAttemptFourteenError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptFourteenError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptFourteenError && equalTo((ActionAttemptFourteenError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptFourteenError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptFourteenError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptFourteenError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptFourteenError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptFourteenError build() { + return new ActionAttemptFourteenError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptNine.java b/src/main/java/com/seam/api/types/ActionAttemptNine.java new file mode 100644 index 0000000..ab82ccd --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptNine.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptNine.Builder.class) +public final class ActionAttemptNine { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptNine( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_COOL"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptNine && equalTo((ActionAttemptNine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptNine other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptNine other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptNine build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptNine other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptNine build() { + return new ActionAttemptNine(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptNineteen.java b/src/main/java/com/seam/api/types/ActionAttemptNineteen.java new file mode 100644 index 0000000..94b2f42 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptNineteen.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptNineteen.Builder.class) +public final class ActionAttemptNineteen { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptNineteenResult result; + + private final Map additionalProperties; + + private ActionAttemptNineteen( + String actionAttemptId, + Object error, + ActionAttemptNineteenResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_FAN_MODE"; + } + + @JsonProperty("result") + public ActionAttemptNineteenResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptNineteen && equalTo((ActionAttemptNineteen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptNineteen other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptNineteen other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptNineteenResult result); + } + + public interface _FinalStage { + ActionAttemptNineteen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptNineteenResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptNineteen other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptNineteenResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptNineteen build() { + return new ActionAttemptNineteen(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptNineteenResult.java b/src/main/java/com/seam/api/types/ActionAttemptNineteenResult.java new file mode 100644 index 0000000..b0edda7 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptNineteenResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptNineteenResult.Builder.class) +public final class ActionAttemptNineteenResult { + private final Map additionalProperties; + + private ActionAttemptNineteenResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptNineteenResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptNineteenResult other) { + return this; + } + + public ActionAttemptNineteenResult build() { + return new ActionAttemptNineteenResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptOne.java b/src/main/java/com/seam/api/types/ActionAttemptOne.java new file mode 100644 index 0000000..53c3cc6 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptOne.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptOne.Builder.class) +public final class ActionAttemptOne { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptOneResult result; + + private final Map additionalProperties; + + private ActionAttemptOne( + String actionAttemptId, + Object error, + ActionAttemptOneResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "LOCK_DOOR"; + } + + @JsonProperty("result") + public ActionAttemptOneResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptOne && equalTo((ActionAttemptOne) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptOne other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptOne other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptOneResult result); + } + + public interface _FinalStage { + ActionAttemptOne build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptOneResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptOne other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptOneResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptOne build() { + return new ActionAttemptOne(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptOneResult.java b/src/main/java/com/seam/api/types/ActionAttemptOneResult.java new file mode 100644 index 0000000..fd9965e --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptOneResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptOneResult.Builder.class) +public final class ActionAttemptOneResult { + private final Map additionalProperties; + + private ActionAttemptOneResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptOneResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptOneResult other) { + return this; + } + + public ActionAttemptOneResult build() { + return new ActionAttemptOneResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptPending.java b/src/main/java/com/seam/api/types/ActionAttemptPending.java deleted file mode 100644 index 541f979..0000000 --- a/src/main/java/com/seam/api/types/ActionAttemptPending.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ActionAttemptPending.Builder.class) -public final class ActionAttemptPending { - private final String actionType; - - private final String actionAttemptId; - - private final Optional result; - - private final Optional error; - - private final Map additionalProperties; - - private ActionAttemptPending( - String actionType, - String actionAttemptId, - Optional result, - Optional error, - Map additionalProperties) { - this.actionType = actionType; - this.actionAttemptId = actionAttemptId; - this.result = result; - this.error = error; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("action_type") - public String getActionType() { - return actionType; - } - - @JsonProperty("action_attempt_id") - public String getActionAttemptId() { - return actionAttemptId; - } - - @JsonProperty("result") - public Optional getResult() { - return result; - } - - @JsonProperty("error") - public Optional getError() { - return error; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActionAttemptPending && equalTo((ActionAttemptPending) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ActionAttemptPending other) { - return actionType.equals(other.actionType) - && actionAttemptId.equals(other.actionAttemptId) - && result.equals(other.result) - && error.equals(other.error); - } - - @Override - public int hashCode() { - return Objects.hash(this.actionType, this.actionAttemptId, this.result, this.error); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ActionTypeStage builder() { - return new Builder(); - } - - public interface ActionTypeStage { - ActionAttemptIdStage actionType(String actionType); - - Builder from(ActionAttemptPending other); - } - - public interface ActionAttemptIdStage { - _FinalStage actionAttemptId(String actionAttemptId); - } - - public interface _FinalStage { - ActionAttemptPending build(); - - _FinalStage result(Optional result); - - _FinalStage result(String result); - - _FinalStage error(Optional error); - - _FinalStage error(String error); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ActionTypeStage, ActionAttemptIdStage, _FinalStage { - private String actionType; - - private String actionAttemptId; - - private Optional error = Optional.empty(); - - private Optional result = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(ActionAttemptPending other) { - actionType(other.getActionType()); - actionAttemptId(other.getActionAttemptId()); - result(other.getResult()); - error(other.getError()); - return this; - } - - @Override - @JsonSetter("action_type") - public ActionAttemptIdStage actionType(String actionType) { - this.actionType = actionType; - return this; - } - - @Override - @JsonSetter("action_attempt_id") - public _FinalStage actionAttemptId(String actionAttemptId) { - this.actionAttemptId = actionAttemptId; - return this; - } - - @Override - public _FinalStage error(String error) { - this.error = Optional.of(error); - return this; - } - - @Override - @JsonSetter(value = "error", nulls = Nulls.SKIP) - public _FinalStage error(Optional error) { - this.error = error; - return this; - } - - @Override - public _FinalStage result(String result) { - this.result = Optional.of(result); - return this; - } - - @Override - @JsonSetter(value = "result", nulls = Nulls.SKIP) - public _FinalStage result(Optional result) { - this.result = result; - return this; - } - - @Override - public ActionAttemptPending build() { - return new ActionAttemptPending(actionType, actionAttemptId, result, error, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSeven.java b/src/main/java/com/seam/api/types/ActionAttemptSeven.java new file mode 100644 index 0000000..3b860fa --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptSeven.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptSeven.Builder.class) +public final class ActionAttemptSeven { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptSevenResult result; + + private final Map additionalProperties; + + private ActionAttemptSeven( + String actionAttemptId, + Object error, + ActionAttemptSevenResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "RESET_SANDBOX_WORKSPACE"; + } + + @JsonProperty("result") + public ActionAttemptSevenResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptSeven && equalTo((ActionAttemptSeven) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptSeven other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptSeven other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptSevenResult result); + } + + public interface _FinalStage { + ActionAttemptSeven build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptSevenResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptSeven other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptSevenResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptSeven build() { + return new ActionAttemptSeven(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSevenResult.java b/src/main/java/com/seam/api/types/ActionAttemptSevenResult.java new file mode 100644 index 0000000..796db58 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptSevenResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptSevenResult.Builder.class) +public final class ActionAttemptSevenResult { + private final Map additionalProperties; + + private ActionAttemptSevenResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptSevenResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptSevenResult other) { + return this; + } + + public ActionAttemptSevenResult build() { + return new ActionAttemptSevenResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSeventeen.java b/src/main/java/com/seam/api/types/ActionAttemptSeventeen.java new file mode 100644 index 0000000..980e761 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptSeventeen.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptSeventeen.Builder.class) +public final class ActionAttemptSeventeen { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptSeventeenError error; + + private final Map additionalProperties; + + private ActionAttemptSeventeen( + String actionAttemptId, + Object result, + ActionAttemptSeventeenError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_HEAT_COOL"; + } + + @JsonProperty("error") + public ActionAttemptSeventeenError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptSeventeen && equalTo((ActionAttemptSeventeen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptSeventeen other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptSeventeen other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptSeventeenError error); + } + + public interface _FinalStage { + ActionAttemptSeventeen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptSeventeenError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptSeventeen other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptSeventeenError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptSeventeen build() { + return new ActionAttemptSeventeen(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSeventeenError.java b/src/main/java/com/seam/api/types/ActionAttemptSeventeenError.java new file mode 100644 index 0000000..ad9475d --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptSeventeenError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptSeventeenError.Builder.class) +public final class ActionAttemptSeventeenError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptSeventeenError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptSeventeenError && equalTo((ActionAttemptSeventeenError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptSeventeenError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptSeventeenError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptSeventeenError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptSeventeenError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptSeventeenError build() { + return new ActionAttemptSeventeenError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSix.java b/src/main/java/com/seam/api/types/ActionAttemptSix.java new file mode 100644 index 0000000..29eda17 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptSix.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptSix.Builder.class) +public final class ActionAttemptSix { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptSix( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "RESET_SANDBOX_WORKSPACE"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptSix && equalTo((ActionAttemptSix) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptSix other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptSix other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptSix build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptSix other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptSix build() { + return new ActionAttemptSix(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSixteen.java b/src/main/java/com/seam/api/types/ActionAttemptSixteen.java new file mode 100644 index 0000000..a409a84 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptSixteen.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptSixteen.Builder.class) +public final class ActionAttemptSixteen { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptSixteenResult result; + + private final Map additionalProperties; + + private ActionAttemptSixteen( + String actionAttemptId, + Object error, + ActionAttemptSixteenResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_HEAT_COOL"; + } + + @JsonProperty("result") + public ActionAttemptSixteenResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptSixteen && equalTo((ActionAttemptSixteen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptSixteen other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptSixteen other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptSixteenResult result); + } + + public interface _FinalStage { + ActionAttemptSixteen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptSixteenResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptSixteen other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptSixteenResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptSixteen build() { + return new ActionAttemptSixteen(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSixteenResult.java b/src/main/java/com/seam/api/types/ActionAttemptSixteenResult.java new file mode 100644 index 0000000..508be34 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptSixteenResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptSixteenResult.Builder.class) +public final class ActionAttemptSixteenResult { + private final Map additionalProperties; + + private ActionAttemptSixteenResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptSixteenResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptSixteenResult other) { + return this; + } + + public ActionAttemptSixteenResult build() { + return new ActionAttemptSixteenResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTen.java b/src/main/java/com/seam/api/types/ActionAttemptTen.java new file mode 100644 index 0000000..809c7d4 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTen.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTen.Builder.class) +public final class ActionAttemptTen { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptTenResult result; + + private final Map additionalProperties; + + private ActionAttemptTen( + String actionAttemptId, + Object error, + ActionAttemptTenResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_COOL"; + } + + @JsonProperty("result") + public ActionAttemptTenResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTen && equalTo((ActionAttemptTen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTen other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTen other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptTenResult result); + } + + public interface _FinalStage { + ActionAttemptTen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptTenResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTen other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptTenResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptTen build() { + return new ActionAttemptTen(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTenResult.java b/src/main/java/com/seam/api/types/ActionAttemptTenResult.java new file mode 100644 index 0000000..8f74514 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTenResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTenResult.Builder.class) +public final class ActionAttemptTenResult { + private final Map additionalProperties; + + private ActionAttemptTenResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTenResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptTenResult other) { + return this; + } + + public ActionAttemptTenResult build() { + return new ActionAttemptTenResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirteen.java b/src/main/java/com/seam/api/types/ActionAttemptThirteen.java new file mode 100644 index 0000000..3776154 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirteen.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirteen.Builder.class) +public final class ActionAttemptThirteen { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptThirteenResult result; + + private final Map additionalProperties; + + private ActionAttemptThirteen( + String actionAttemptId, + Object error, + ActionAttemptThirteenResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_HEAT"; + } + + @JsonProperty("result") + public ActionAttemptThirteenResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirteen && equalTo((ActionAttemptThirteen) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirteen other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirteen other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptThirteenResult result); + } + + public interface _FinalStage { + ActionAttemptThirteen build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptThirteenResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirteen other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptThirteenResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptThirteen build() { + return new ActionAttemptThirteen(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirteenResult.java b/src/main/java/com/seam/api/types/ActionAttemptThirteenResult.java new file mode 100644 index 0000000..9c491e2 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirteenResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirteenResult.Builder.class) +public final class ActionAttemptThirteenResult { + private final Map additionalProperties; + + private ActionAttemptThirteenResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirteenResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptThirteenResult other) { + return this; + } + + public ActionAttemptThirteenResult build() { + return new ActionAttemptThirteenResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirty.java b/src/main/java/com/seam/api/types/ActionAttemptThirty.java new file mode 100644 index 0000000..b242563 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirty.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirty.Builder.class) +public final class ActionAttemptThirty { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptThirty( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "DELETE_ACCESS_CODE"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirty && equalTo((ActionAttemptThirty) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirty other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirty other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptThirty build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirty other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThirty build() { + return new ActionAttemptThirty(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyEight.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyEight.java new file mode 100644 index 0000000..a10aec4 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyEight.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyEight.Builder.class) +public final class ActionAttemptThirtyEight { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptThirtyEightError error; + + private final Map additionalProperties; + + private ActionAttemptThirtyEight( + String actionAttemptId, + Object result, + ActionAttemptThirtyEightError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "CREATE_NOISE_THRESHOLD"; + } + + @JsonProperty("error") + public ActionAttemptThirtyEightError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyEight && equalTo((ActionAttemptThirtyEight) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyEight other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtyEight other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptThirtyEightError error); + } + + public interface _FinalStage { + ActionAttemptThirtyEight build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptThirtyEightError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyEight other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptThirtyEightError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyEight build() { + return new ActionAttemptThirtyEight(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyEightError.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyEightError.java new file mode 100644 index 0000000..e21b0be --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyEightError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyEightError.Builder.class) +public final class ActionAttemptThirtyEightError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptThirtyEightError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyEightError && equalTo((ActionAttemptThirtyEightError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyEightError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptThirtyEightError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptThirtyEightError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyEightError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyEightError build() { + return new ActionAttemptThirtyEightError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyFive.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyFive.java new file mode 100644 index 0000000..5dd8748 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyFive.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyFive.Builder.class) +public final class ActionAttemptThirtyFive { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptThirtyFiveError error; + + private final Map additionalProperties; + + private ActionAttemptThirtyFive( + String actionAttemptId, + Object result, + ActionAttemptThirtyFiveError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UPDATE_ACCESS_CODE"; + } + + @JsonProperty("error") + public ActionAttemptThirtyFiveError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyFive && equalTo((ActionAttemptThirtyFive) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyFive other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtyFive other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptThirtyFiveError error); + } + + public interface _FinalStage { + ActionAttemptThirtyFive build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptThirtyFiveError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyFive other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptThirtyFiveError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyFive build() { + return new ActionAttemptThirtyFive(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyFiveError.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyFiveError.java new file mode 100644 index 0000000..035bdad --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyFiveError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyFiveError.Builder.class) +public final class ActionAttemptThirtyFiveError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptThirtyFiveError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyFiveError && equalTo((ActionAttemptThirtyFiveError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyFiveError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptThirtyFiveError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptThirtyFiveError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyFiveError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyFiveError build() { + return new ActionAttemptThirtyFiveError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyFour.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyFour.java new file mode 100644 index 0000000..060780a --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyFour.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyFour.Builder.class) +public final class ActionAttemptThirtyFour { + private final String actionAttemptId; + + private final Object error; + + private final Optional result; + + private final Map additionalProperties; + + private ActionAttemptThirtyFour( + String actionAttemptId, Object error, Optional result, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UPDATE_ACCESS_CODE"; + } + + @JsonProperty("result") + public Optional getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyFour && equalTo((ActionAttemptThirtyFour) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyFour other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtyFour other); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptThirtyFour build(); + + _FinalStage result(Optional result); + + _FinalStage result(Object result); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private Optional result = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyFour other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public _FinalStage result(Object result) { + this.result = Optional.of(result); + return this; + } + + @java.lang.Override + @JsonSetter(value = "result", nulls = Nulls.SKIP) + public _FinalStage result(Optional result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyFour build() { + return new ActionAttemptThirtyFour(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyNine.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyNine.java new file mode 100644 index 0000000..ea44185 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyNine.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyNine.Builder.class) +public final class ActionAttemptThirtyNine { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptThirtyNine( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "DELETE_NOISE_THRESHOLD"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyNine && equalTo((ActionAttemptThirtyNine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyNine other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtyNine other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptThirtyNine build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyNine other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyNine build() { + return new ActionAttemptThirtyNine(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptSuccess.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyOne.java similarity index 54% rename from src/main/java/com/seam/api/types/ActionAttemptSuccess.java rename to src/main/java/com/seam/api/types/ActionAttemptThirtyOne.java index 4121daa..f533651 100644 --- a/src/main/java/com/seam/api/types/ActionAttemptSuccess.java +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyOne.java @@ -18,55 +18,56 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ActionAttemptSuccess.Builder.class) -public final class ActionAttemptSuccess { - private final String actionType; - +@JsonDeserialize(builder = ActionAttemptThirtyOne.Builder.class) +public final class ActionAttemptThirtyOne { private final String actionAttemptId; - private final Optional result; + private final Object error; - private final Optional error; + private final Optional result; private final Map additionalProperties; - private ActionAttemptSuccess( - String actionType, - String actionAttemptId, - Optional result, - Optional error, - Map additionalProperties) { - this.actionType = actionType; + private ActionAttemptThirtyOne( + String actionAttemptId, Object error, Optional result, Map additionalProperties) { this.actionAttemptId = actionAttemptId; - this.result = result; this.error = error; + this.result = result; this.additionalProperties = additionalProperties; } - @JsonProperty("action_type") - public String getActionType() { - return actionType; - } - + /** + * @return The ID of the action attempt. + */ @JsonProperty("action_attempt_id") public String getActionAttemptId() { return actionAttemptId; } - @JsonProperty("result") - public Optional getResult() { - return result; + @JsonProperty("status") + public String getStatus() { + return "success"; } @JsonProperty("error") - public Optional getError() { + public Object getError() { return error; } - @Override + @JsonProperty("action_type") + public String getActionType() { + return "DELETE_ACCESS_CODE"; + } + + @JsonProperty("result") + public Optional getResult() { + return result; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ActionAttemptSuccess && equalTo((ActionAttemptSuccess) other); + return other instanceof ActionAttemptThirtyOne && equalTo((ActionAttemptThirtyOne) other); } @JsonAnyGetter @@ -74,56 +75,49 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ActionAttemptSuccess other) { - return actionType.equals(other.actionType) - && actionAttemptId.equals(other.actionAttemptId) - && result.equals(other.result) - && error.equals(other.error); + private boolean equalTo(ActionAttemptThirtyOne other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.actionType, this.actionAttemptId, this.result, this.error); + return Objects.hash(this.actionAttemptId, this.error, this.result); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } - public static ActionTypeStage builder() { + public static ActionAttemptIdStage builder() { return new Builder(); } - public interface ActionTypeStage { - ActionAttemptIdStage actionType(String actionType); + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); - Builder from(ActionAttemptSuccess other); + Builder from(ActionAttemptThirtyOne other); } - public interface ActionAttemptIdStage { - _FinalStage actionAttemptId(String actionAttemptId); + public interface ErrorStage { + _FinalStage error(Object error); } public interface _FinalStage { - ActionAttemptSuccess build(); + ActionAttemptThirtyOne build(); _FinalStage result(Optional result); _FinalStage result(Object result); - - _FinalStage error(Optional error); - - _FinalStage error(String error); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ActionTypeStage, ActionAttemptIdStage, _FinalStage { - private String actionType; - + public static final class Builder implements ActionAttemptIdStage, ErrorStage, _FinalStage { private String actionAttemptId; - private Optional error = Optional.empty(); + private Object error; private Optional result = Optional.empty(); @@ -132,58 +126,48 @@ public static final class Builder implements ActionTypeStage, ActionAttemptIdSta private Builder() {} - @Override - public Builder from(ActionAttemptSuccess other) { - actionType(other.getActionType()); + @java.lang.Override + public Builder from(ActionAttemptThirtyOne other) { actionAttemptId(other.getActionAttemptId()); - result(other.getResult()); error(other.getError()); + result(other.getResult()); return this; } - @Override - @JsonSetter("action_type") - public ActionAttemptIdStage actionType(String actionType) { - this.actionType = actionType; - return this; - } - - @Override + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("action_attempt_id") - public _FinalStage actionAttemptId(String actionAttemptId) { + public ErrorStage actionAttemptId(String actionAttemptId) { this.actionAttemptId = actionAttemptId; return this; } - @Override - public _FinalStage error(String error) { - this.error = Optional.of(error); - return this; - } - - @Override - @JsonSetter(value = "error", nulls = Nulls.SKIP) - public _FinalStage error(Optional error) { + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { this.error = error; return this; } - @Override + @java.lang.Override public _FinalStage result(Object result) { this.result = Optional.of(result); return this; } - @Override + @java.lang.Override @JsonSetter(value = "result", nulls = Nulls.SKIP) public _FinalStage result(Optional result) { this.result = result; return this; } - @Override - public ActionAttemptSuccess build() { - return new ActionAttemptSuccess(actionType, actionAttemptId, result, error, additionalProperties); + @java.lang.Override + public ActionAttemptThirtyOne build() { + return new ActionAttemptThirtyOne(actionAttemptId, error, result, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtySeven.java b/src/main/java/com/seam/api/types/ActionAttemptThirtySeven.java new file mode 100644 index 0000000..8ba87ca --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtySeven.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtySeven.Builder.class) +public final class ActionAttemptThirtySeven { + private final String actionAttemptId; + + private final Object error; + + private final Optional result; + + private final Map additionalProperties; + + private ActionAttemptThirtySeven( + String actionAttemptId, Object error, Optional result, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "CREATE_NOISE_THRESHOLD"; + } + + @JsonProperty("result") + public Optional getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtySeven && equalTo((ActionAttemptThirtySeven) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtySeven other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtySeven other); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptThirtySeven build(); + + _FinalStage result(Optional result); + + _FinalStage result(Object result); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private Optional result = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtySeven other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public _FinalStage result(Object result) { + this.result = Optional.of(result); + return this; + } + + @java.lang.Override + @JsonSetter(value = "result", nulls = Nulls.SKIP) + public _FinalStage result(Optional result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptThirtySeven build() { + return new ActionAttemptThirtySeven(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtySix.java b/src/main/java/com/seam/api/types/ActionAttemptThirtySix.java new file mode 100644 index 0000000..f86f69f --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtySix.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtySix.Builder.class) +public final class ActionAttemptThirtySix { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptThirtySix( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "CREATE_NOISE_THRESHOLD"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtySix && equalTo((ActionAttemptThirtySix) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtySix other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtySix other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptThirtySix build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtySix other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThirtySix build() { + return new ActionAttemptThirtySix(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyThree.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyThree.java new file mode 100644 index 0000000..2b55b6c --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyThree.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyThree.Builder.class) +public final class ActionAttemptThirtyThree { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptThirtyThree( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UPDATE_ACCESS_CODE"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyThree && equalTo((ActionAttemptThirtyThree) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyThree other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtyThree other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptThirtyThree build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyThree other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyThree build() { + return new ActionAttemptThirtyThree(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyTwo.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyTwo.java new file mode 100644 index 0000000..02c29d6 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyTwo.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyTwo.Builder.class) +public final class ActionAttemptThirtyTwo { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptThirtyTwoError error; + + private final Map additionalProperties; + + private ActionAttemptThirtyTwo( + String actionAttemptId, + Object result, + ActionAttemptThirtyTwoError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "DELETE_ACCESS_CODE"; + } + + @JsonProperty("error") + public ActionAttemptThirtyTwoError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyTwo && equalTo((ActionAttemptThirtyTwo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyTwo other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThirtyTwo other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptThirtyTwoError error); + } + + public interface _FinalStage { + ActionAttemptThirtyTwo build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptThirtyTwoError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyTwo other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptThirtyTwoError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyTwo build() { + return new ActionAttemptThirtyTwo(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThirtyTwoError.java b/src/main/java/com/seam/api/types/ActionAttemptThirtyTwoError.java new file mode 100644 index 0000000..7058ce7 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThirtyTwoError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThirtyTwoError.Builder.class) +public final class ActionAttemptThirtyTwoError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptThirtyTwoError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThirtyTwoError && equalTo((ActionAttemptThirtyTwoError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThirtyTwoError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptThirtyTwoError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptThirtyTwoError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThirtyTwoError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptThirtyTwoError build() { + return new ActionAttemptThirtyTwoError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptThree.java b/src/main/java/com/seam/api/types/ActionAttemptThree.java new file mode 100644 index 0000000..0c68011 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptThree.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptThree.Builder.class) +public final class ActionAttemptThree { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptThree( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "UNLOCK_DOOR"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptThree && equalTo((ActionAttemptThree) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptThree other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptThree other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptThree build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptThree other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptThree build() { + return new ActionAttemptThree(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwelve.java b/src/main/java/com/seam/api/types/ActionAttemptTwelve.java new file mode 100644 index 0000000..b9a05ab --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwelve.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwelve.Builder.class) +public final class ActionAttemptTwelve { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptTwelve( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_HEAT"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwelve && equalTo((ActionAttemptTwelve) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwelve other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwelve other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptTwelve build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwelve other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwelve build() { + return new ActionAttemptTwelve(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwenty.java b/src/main/java/com/seam/api/types/ActionAttemptTwenty.java new file mode 100644 index 0000000..954ba84 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwenty.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwenty.Builder.class) +public final class ActionAttemptTwenty { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptTwentyError error; + + private final Map additionalProperties; + + private ActionAttemptTwenty( + String actionAttemptId, + Object result, + ActionAttemptTwentyError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_FAN_MODE"; + } + + @JsonProperty("error") + public ActionAttemptTwentyError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwenty && equalTo((ActionAttemptTwenty) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwenty other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwenty other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptTwentyError error); + } + + public interface _FinalStage { + ActionAttemptTwenty build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptTwentyError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwenty other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptTwentyError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwenty build() { + return new ActionAttemptTwenty(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyEight.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyEight.java new file mode 100644 index 0000000..c1e7c12 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyEight.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyEight.Builder.class) +public final class ActionAttemptTwentyEight { + private final String actionAttemptId; + + private final Object error; + + private final Optional result; + + private final Map additionalProperties; + + private ActionAttemptTwentyEight( + String actionAttemptId, Object error, Optional result, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "CREATE_ACCESS_CODE"; + } + + @JsonProperty("result") + public Optional getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyEight && equalTo((ActionAttemptTwentyEight) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyEight other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentyEight other); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptTwentyEight build(); + + _FinalStage result(Optional result); + + _FinalStage result(Object result); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private Optional result = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyEight other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public _FinalStage result(Object result) { + this.result = Optional.of(result); + return this; + } + + @java.lang.Override + @JsonSetter(value = "result", nulls = Nulls.SKIP) + public _FinalStage result(Optional result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyEight build() { + return new ActionAttemptTwentyEight(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyError.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyError.java new file mode 100644 index 0000000..0e345e9 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyError.Builder.class) +public final class ActionAttemptTwentyError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptTwentyError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyError && equalTo((ActionAttemptTwentyError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptTwentyError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptTwentyError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyError build() { + return new ActionAttemptTwentyError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyFive.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyFive.java new file mode 100644 index 0000000..2c4132d --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyFive.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyFive.Builder.class) +public final class ActionAttemptTwentyFive { + private final String actionAttemptId; + + private final Object error; + + private final Optional result; + + private final Map additionalProperties; + + private ActionAttemptTwentyFive( + String actionAttemptId, Object error, Optional result, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SYNC_ACCESS_CODES"; + } + + @JsonProperty("result") + public Optional getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyFive && equalTo((ActionAttemptTwentyFive) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyFive other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentyFive other); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptTwentyFive build(); + + _FinalStage result(Optional result); + + _FinalStage result(Object result); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private Optional result = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyFive other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public _FinalStage result(Object result) { + this.result = Optional.of(result); + return this; + } + + @java.lang.Override + @JsonSetter(value = "result", nulls = Nulls.SKIP) + public _FinalStage result(Optional result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyFive build() { + return new ActionAttemptTwentyFive(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyFour.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyFour.java new file mode 100644 index 0000000..58024e1 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyFour.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyFour.Builder.class) +public final class ActionAttemptTwentyFour { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptTwentyFour( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SYNC_ACCESS_CODES"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyFour && equalTo((ActionAttemptTwentyFour) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyFour other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentyFour other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptTwentyFour build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyFour other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyFour build() { + return new ActionAttemptTwentyFour(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyNine.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyNine.java new file mode 100644 index 0000000..06d4e91 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyNine.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyNine.Builder.class) +public final class ActionAttemptTwentyNine { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptTwentyNineError error; + + private final Map additionalProperties; + + private ActionAttemptTwentyNine( + String actionAttemptId, + Object result, + ActionAttemptTwentyNineError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "CREATE_ACCESS_CODE"; + } + + @JsonProperty("error") + public ActionAttemptTwentyNineError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyNine && equalTo((ActionAttemptTwentyNine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyNine other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentyNine other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptTwentyNineError error); + } + + public interface _FinalStage { + ActionAttemptTwentyNine build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptTwentyNineError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyNine other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptTwentyNineError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyNine build() { + return new ActionAttemptTwentyNine(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyNineError.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyNineError.java new file mode 100644 index 0000000..a814e61 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyNineError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyNineError.Builder.class) +public final class ActionAttemptTwentyNineError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptTwentyNineError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyNineError && equalTo((ActionAttemptTwentyNineError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyNineError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptTwentyNineError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptTwentyNineError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyNineError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyNineError build() { + return new ActionAttemptTwentyNineError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyOne.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyOne.java new file mode 100644 index 0000000..1f745d5 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyOne.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyOne.Builder.class) +public final class ActionAttemptTwentyOne { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptTwentyOne( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_THERMOSTAT_OFF"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyOne && equalTo((ActionAttemptTwentyOne) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyOne other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentyOne other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptTwentyOne build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyOne other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyOne build() { + return new ActionAttemptTwentyOne(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentySeven.java b/src/main/java/com/seam/api/types/ActionAttemptTwentySeven.java new file mode 100644 index 0000000..4478e4b --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentySeven.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentySeven.Builder.class) +public final class ActionAttemptTwentySeven { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptTwentySeven( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "CREATE_ACCESS_CODE"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentySeven && equalTo((ActionAttemptTwentySeven) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentySeven other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentySeven other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptTwentySeven build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentySeven other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwentySeven build() { + return new ActionAttemptTwentySeven(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentySix.java b/src/main/java/com/seam/api/types/ActionAttemptTwentySix.java new file mode 100644 index 0000000..d62342c --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentySix.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentySix.Builder.class) +public final class ActionAttemptTwentySix { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptTwentySixError error; + + private final Map additionalProperties; + + private ActionAttemptTwentySix( + String actionAttemptId, + Object result, + ActionAttemptTwentySixError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SYNC_ACCESS_CODES"; + } + + @JsonProperty("error") + public ActionAttemptTwentySixError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentySix && equalTo((ActionAttemptTwentySix) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentySix other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentySix other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptTwentySixError error); + } + + public interface _FinalStage { + ActionAttemptTwentySix build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptTwentySixError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentySix other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptTwentySixError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwentySix build() { + return new ActionAttemptTwentySix(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentySixError.java b/src/main/java/com/seam/api/types/ActionAttemptTwentySixError.java new file mode 100644 index 0000000..ede398b --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentySixError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentySixError.Builder.class) +public final class ActionAttemptTwentySixError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptTwentySixError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentySixError && equalTo((ActionAttemptTwentySixError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentySixError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptTwentySixError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptTwentySixError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentySixError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptTwentySixError build() { + return new ActionAttemptTwentySixError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyThree.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyThree.java new file mode 100644 index 0000000..985995b --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyThree.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyThree.Builder.class) +public final class ActionAttemptTwentyThree { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptTwentyThreeError error; + + private final Map additionalProperties; + + private ActionAttemptTwentyThree( + String actionAttemptId, + Object result, + ActionAttemptTwentyThreeError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_THERMOSTAT_OFF"; + } + + @JsonProperty("error") + public ActionAttemptTwentyThreeError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyThree && equalTo((ActionAttemptTwentyThree) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyThree other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentyThree other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptTwentyThreeError error); + } + + public interface _FinalStage { + ActionAttemptTwentyThree build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptTwentyThreeError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyThree other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptTwentyThreeError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyThree build() { + return new ActionAttemptTwentyThree(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyThreeError.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyThreeError.java new file mode 100644 index 0000000..fadab42 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyThreeError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyThreeError.Builder.class) +public final class ActionAttemptTwentyThreeError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptTwentyThreeError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyThreeError && equalTo((ActionAttemptTwentyThreeError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyThreeError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptTwentyThreeError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptTwentyThreeError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyThreeError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyThreeError build() { + return new ActionAttemptTwentyThreeError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyTwo.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyTwo.java new file mode 100644 index 0000000..daa7664 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyTwo.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyTwo.Builder.class) +public final class ActionAttemptTwentyTwo { + private final String actionAttemptId; + + private final Object error; + + private final ActionAttemptTwentyTwoResult result; + + private final Map additionalProperties; + + private ActionAttemptTwentyTwo( + String actionAttemptId, + Object error, + ActionAttemptTwentyTwoResult result, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.error = error; + this.result = result; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "success"; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "SET_THERMOSTAT_OFF"; + } + + @JsonProperty("result") + public ActionAttemptTwentyTwoResult getResult() { + return result; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyTwo && equalTo((ActionAttemptTwentyTwo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwentyTwo other) { + return actionAttemptId.equals(other.actionAttemptId) + && error.equals(other.error) + && result.equals(other.result); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.error, this.result); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ErrorStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwentyTwo other); + } + + public interface ErrorStage { + ResultStage error(Object error); + } + + public interface ResultStage { + _FinalStage result(ActionAttemptTwentyTwoResult result); + } + + public interface _FinalStage { + ActionAttemptTwentyTwo build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ErrorStage, ResultStage, _FinalStage { + private String actionAttemptId; + + private Object error; + + private ActionAttemptTwentyTwoResult result; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwentyTwo other) { + actionAttemptId(other.getActionAttemptId()); + error(other.getError()); + result(other.getResult()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ErrorStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public ResultStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public _FinalStage result(ActionAttemptTwentyTwoResult result) { + this.result = result; + return this; + } + + @java.lang.Override + public ActionAttemptTwentyTwo build() { + return new ActionAttemptTwentyTwo(actionAttemptId, error, result, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwentyTwoResult.java b/src/main/java/com/seam/api/types/ActionAttemptTwentyTwoResult.java new file mode 100644 index 0000000..01abbac --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwentyTwoResult.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwentyTwoResult.Builder.class) +public final class ActionAttemptTwentyTwoResult { + private final Map additionalProperties; + + private ActionAttemptTwentyTwoResult(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwentyTwoResult; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ActionAttemptTwentyTwoResult other) { + return this; + } + + public ActionAttemptTwentyTwoResult build() { + return new ActionAttemptTwentyTwoResult(additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwo.java b/src/main/java/com/seam/api/types/ActionAttemptTwo.java new file mode 100644 index 0000000..abb03f9 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwo.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwo.Builder.class) +public final class ActionAttemptTwo { + private final String actionAttemptId; + + private final Object result; + + private final ActionAttemptTwoError error; + + private final Map additionalProperties; + + private ActionAttemptTwo( + String actionAttemptId, + Object result, + ActionAttemptTwoError error, + Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "error"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("action_type") + public String getActionType() { + return "LOCK_DOOR"; + } + + @JsonProperty("error") + public ActionAttemptTwoError getError() { + return error; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwo && equalTo((ActionAttemptTwo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwo other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptTwo other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(ActionAttemptTwoError error); + } + + public interface _FinalStage { + ActionAttemptTwo build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private ActionAttemptTwoError error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwo other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(ActionAttemptTwoError error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptTwo build() { + return new ActionAttemptTwo(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptTwoError.java b/src/main/java/com/seam/api/types/ActionAttemptTwoError.java new file mode 100644 index 0000000..121b29d --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptTwoError.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptTwoError.Builder.class) +public final class ActionAttemptTwoError { + private final String type; + + private final String message; + + private final Map additionalProperties; + + private ActionAttemptTwoError(String type, String message, Map additionalProperties) { + this.type = type; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptTwoError && equalTo((ActionAttemptTwoError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptTwoError other) { + return type.equals(other.type) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + MessageStage type(String type); + + Builder from(ActionAttemptTwoError other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + ActionAttemptTwoError build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, MessageStage, _FinalStage { + private String type; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptTwoError other) { + type(other.getType()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public MessageStage type(String type) { + this.type = type; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public ActionAttemptTwoError build() { + return new ActionAttemptTwoError(type, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ActionAttemptZero.java b/src/main/java/com/seam/api/types/ActionAttemptZero.java new file mode 100644 index 0000000..5dd1fd9 --- /dev/null +++ b/src/main/java/com/seam/api/types/ActionAttemptZero.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = ActionAttemptZero.Builder.class) +public final class ActionAttemptZero { + private final String actionAttemptId; + + private final Object result; + + private final Object error; + + private final Map additionalProperties; + + private ActionAttemptZero( + String actionAttemptId, Object result, Object error, Map additionalProperties) { + this.actionAttemptId = actionAttemptId; + this.result = result; + this.error = error; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the action attempt. + */ + @JsonProperty("action_attempt_id") + public String getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("status") + public String getStatus() { + return "pending"; + } + + @JsonProperty("result") + public Object getResult() { + return result; + } + + @JsonProperty("error") + public Object getError() { + return error; + } + + @JsonProperty("action_type") + public String getActionType() { + return "LOCK_DOOR"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ActionAttemptZero && equalTo((ActionAttemptZero) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ActionAttemptZero other) { + return actionAttemptId.equals(other.actionAttemptId) + && result.equals(other.result) + && error.equals(other.error); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.actionAttemptId, this.result, this.error); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ActionAttemptIdStage builder() { + return new Builder(); + } + + public interface ActionAttemptIdStage { + ResultStage actionAttemptId(String actionAttemptId); + + Builder from(ActionAttemptZero other); + } + + public interface ResultStage { + ErrorStage result(Object result); + } + + public interface ErrorStage { + _FinalStage error(Object error); + } + + public interface _FinalStage { + ActionAttemptZero build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ActionAttemptIdStage, ResultStage, ErrorStage, _FinalStage { + private String actionAttemptId; + + private Object result; + + private Object error; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ActionAttemptZero other) { + actionAttemptId(other.getActionAttemptId()); + result(other.getResult()); + error(other.getError()); + return this; + } + + /** + *

The ID of the action attempt.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("action_attempt_id") + public ResultStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override + @JsonSetter("result") + public ErrorStage result(Object result) { + this.result = result; + return this; + } + + @java.lang.Override + @JsonSetter("error") + public _FinalStage error(Object error) { + this.error = error; + return this; + } + + @java.lang.Override + public ActionAttemptZero build() { + return new ActionAttemptZero(actionAttemptId, result, error, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ClientSession.java b/src/main/java/com/seam/api/types/ClientSession.java index 59f04d4..66b6c4e 100644 --- a/src/main/java/com/seam/api/types/ClientSession.java +++ b/src/main/java/com/seam/api/types/ClientSession.java @@ -25,40 +25,44 @@ public final class ClientSession { private final String clientSessionId; - private final Optional userIdentifierKey; + private final String workspaceId; private final OffsetDateTime createdAt; private final String token; + private final Optional userIdentifierKey; + private final double deviceCount; private final List connectedAccountIds; private final List connectWebviewIds; - private final String workspaceId; + private final List userIdentityIds; private final Map additionalProperties; private ClientSession( String clientSessionId, - Optional userIdentifierKey, + String workspaceId, OffsetDateTime createdAt, String token, + Optional userIdentifierKey, double deviceCount, List connectedAccountIds, List connectWebviewIds, - String workspaceId, + List userIdentityIds, Map additionalProperties) { this.clientSessionId = clientSessionId; - this.userIdentifierKey = userIdentifierKey; + this.workspaceId = workspaceId; this.createdAt = createdAt; this.token = token; + this.userIdentifierKey = userIdentifierKey; this.deviceCount = deviceCount; this.connectedAccountIds = connectedAccountIds; this.connectWebviewIds = connectWebviewIds; - this.workspaceId = workspaceId; + this.userIdentityIds = userIdentityIds; this.additionalProperties = additionalProperties; } @@ -67,9 +71,9 @@ public String getClientSessionId() { return clientSessionId; } - @JsonProperty("user_identifier_key") - public Optional getUserIdentifierKey() { - return userIdentifierKey; + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; } @JsonProperty("created_at") @@ -82,6 +86,11 @@ public String getToken() { return token; } + @JsonProperty("user_identifier_key") + public Optional getUserIdentifierKey() { + return userIdentifierKey; + } + @JsonProperty("device_count") public double getDeviceCount() { return deviceCount; @@ -97,12 +106,12 @@ public List getConnectWebviewIds() { return connectWebviewIds; } - @JsonProperty("workspace_id") - public String getWorkspaceId() { - return workspaceId; + @JsonProperty("user_identity_ids") + public List getUserIdentityIds() { + return userIdentityIds; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClientSession && equalTo((ClientSession) other); @@ -115,29 +124,31 @@ public Map getAdditionalProperties() { private boolean equalTo(ClientSession other) { return clientSessionId.equals(other.clientSessionId) - && userIdentifierKey.equals(other.userIdentifierKey) + && workspaceId.equals(other.workspaceId) && createdAt.equals(other.createdAt) && token.equals(other.token) + && userIdentifierKey.equals(other.userIdentifierKey) && deviceCount == other.deviceCount && connectedAccountIds.equals(other.connectedAccountIds) && connectWebviewIds.equals(other.connectWebviewIds) - && workspaceId.equals(other.workspaceId); + && userIdentityIds.equals(other.userIdentityIds); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.clientSessionId, - this.userIdentifierKey, + this.workspaceId, this.createdAt, this.token, + this.userIdentifierKey, this.deviceCount, this.connectedAccountIds, this.connectWebviewIds, - this.workspaceId); + this.userIdentityIds); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -147,11 +158,15 @@ public static ClientSessionIdStage builder() { } public interface ClientSessionIdStage { - CreatedAtStage clientSessionId(String clientSessionId); + WorkspaceIdStage clientSessionId(String clientSessionId); Builder from(ClientSession other); } + public interface WorkspaceIdStage { + CreatedAtStage workspaceId(String workspaceId); + } + public interface CreatedAtStage { TokenStage createdAt(OffsetDateTime createdAt); } @@ -161,11 +176,7 @@ public interface TokenStage { } public interface DeviceCountStage { - WorkspaceIdStage deviceCount(double deviceCount); - } - - public interface WorkspaceIdStage { - _FinalStage workspaceId(String workspaceId); + _FinalStage deviceCount(double deviceCount); } public interface _FinalStage { @@ -186,25 +197,33 @@ public interface _FinalStage { _FinalStage addConnectWebviewIds(String connectWebviewIds); _FinalStage addAllConnectWebviewIds(List connectWebviewIds); + + _FinalStage userIdentityIds(List userIdentityIds); + + _FinalStage addUserIdentityIds(String userIdentityIds); + + _FinalStage addAllUserIdentityIds(List userIdentityIds); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ClientSessionIdStage, + WorkspaceIdStage, CreatedAtStage, TokenStage, DeviceCountStage, - WorkspaceIdStage, _FinalStage { private String clientSessionId; + private String workspaceId; + private OffsetDateTime createdAt; private String token; private double deviceCount; - private String workspaceId; + private List userIdentityIds = new ArrayList<>(); private List connectWebviewIds = new ArrayList<>(); @@ -217,67 +236,88 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ClientSession other) { clientSessionId(other.getClientSessionId()); - userIdentifierKey(other.getUserIdentifierKey()); + workspaceId(other.getWorkspaceId()); createdAt(other.getCreatedAt()); token(other.getToken()); + userIdentifierKey(other.getUserIdentifierKey()); deviceCount(other.getDeviceCount()); connectedAccountIds(other.getConnectedAccountIds()); connectWebviewIds(other.getConnectWebviewIds()); - workspaceId(other.getWorkspaceId()); + userIdentityIds(other.getUserIdentityIds()); return this; } - @Override + @java.lang.Override @JsonSetter("client_session_id") - public CreatedAtStage clientSessionId(String clientSessionId) { + public WorkspaceIdStage clientSessionId(String clientSessionId) { this.clientSessionId = clientSessionId; return this; } - @Override + @java.lang.Override + @JsonSetter("workspace_id") + public CreatedAtStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override @JsonSetter("created_at") public TokenStage createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override @JsonSetter("token") public DeviceCountStage token(String token) { this.token = token; return this; } - @Override + @java.lang.Override @JsonSetter("device_count") - public WorkspaceIdStage deviceCount(double deviceCount) { + public _FinalStage deviceCount(double deviceCount) { this.deviceCount = deviceCount; return this; } - @Override - @JsonSetter("workspace_id") - public _FinalStage workspaceId(String workspaceId) { - this.workspaceId = workspaceId; + @java.lang.Override + public _FinalStage addAllUserIdentityIds(List userIdentityIds) { + this.userIdentityIds.addAll(userIdentityIds); + return this; + } + + @java.lang.Override + public _FinalStage addUserIdentityIds(String userIdentityIds) { + this.userIdentityIds.add(userIdentityIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_ids", nulls = Nulls.SKIP) + public _FinalStage userIdentityIds(List userIdentityIds) { + this.userIdentityIds.clear(); + this.userIdentityIds.addAll(userIdentityIds); return this; } - @Override + @java.lang.Override public _FinalStage addAllConnectWebviewIds(List connectWebviewIds) { this.connectWebviewIds.addAll(connectWebviewIds); return this; } - @Override + @java.lang.Override public _FinalStage addConnectWebviewIds(String connectWebviewIds) { this.connectWebviewIds.add(connectWebviewIds); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connect_webview_ids", nulls = Nulls.SKIP) public _FinalStage connectWebviewIds(List connectWebviewIds) { this.connectWebviewIds.clear(); @@ -285,19 +325,19 @@ public _FinalStage connectWebviewIds(List connectWebviewIds) { return this; } - @Override + @java.lang.Override public _FinalStage addAllConnectedAccountIds(List connectedAccountIds) { this.connectedAccountIds.addAll(connectedAccountIds); return this; } - @Override + @java.lang.Override public _FinalStage addConnectedAccountIds(String connectedAccountIds) { this.connectedAccountIds.add(connectedAccountIds); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connected_account_ids", nulls = Nulls.SKIP) public _FinalStage connectedAccountIds(List connectedAccountIds) { this.connectedAccountIds.clear(); @@ -305,30 +345,31 @@ public _FinalStage connectedAccountIds(List connectedAccountIds) { return this; } - @Override + @java.lang.Override public _FinalStage userIdentifierKey(String userIdentifierKey) { this.userIdentifierKey = Optional.of(userIdentifierKey); return this; } - @Override + @java.lang.Override @JsonSetter(value = "user_identifier_key", nulls = Nulls.SKIP) public _FinalStage userIdentifierKey(Optional userIdentifierKey) { this.userIdentifierKey = userIdentifierKey; return this; } - @Override + @java.lang.Override public ClientSession build() { return new ClientSession( clientSessionId, - userIdentifierKey, + workspaceId, createdAt, token, + userIdentifierKey, deviceCount, connectedAccountIds, connectWebviewIds, - workspaceId, + userIdentityIds, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/ClimateSettingSchedule.java b/src/main/java/com/seam/api/types/ClimateSettingSchedule.java index 085bdea..aaf2837 100644 --- a/src/main/java/com/seam/api/types/ClimateSettingSchedule.java +++ b/src/main/java/com/seam/api/types/ClimateSettingSchedule.java @@ -33,11 +33,13 @@ public final class ClimateSettingSchedule { private final OffsetDateTime createdAt; + private final Optional errors; + private final Optional automaticHeatingEnabled; private final Optional automaticCoolingEnabled; - private final Optional hvacModeSetting; + private final Optional hvacModeSetting; private final Optional coolingSetPointCelsius; @@ -58,9 +60,10 @@ private ClimateSettingSchedule( String scheduleStartsAt, String scheduleEndsAt, OffsetDateTime createdAt, + Optional errors, Optional automaticHeatingEnabled, Optional automaticCoolingEnabled, - Optional hvacModeSetting, + Optional hvacModeSetting, Optional coolingSetPointCelsius, Optional heatingSetPointCelsius, Optional coolingSetPointFahrenheit, @@ -73,6 +76,7 @@ private ClimateSettingSchedule( this.scheduleStartsAt = scheduleStartsAt; this.scheduleEndsAt = scheduleEndsAt; this.createdAt = createdAt; + this.errors = errors; this.automaticHeatingEnabled = automaticHeatingEnabled; this.automaticCoolingEnabled = automaticCoolingEnabled; this.hvacModeSetting = hvacModeSetting; @@ -119,6 +123,11 @@ public OffsetDateTime getCreatedAt() { return createdAt; } + @JsonProperty("errors") + public Optional getErrors() { + return errors; + } + @JsonProperty("automatic_heating_enabled") public Optional getAutomaticHeatingEnabled() { return automaticHeatingEnabled; @@ -130,7 +139,7 @@ public Optional getAutomaticCoolingEnabled() { } @JsonProperty("hvac_mode_setting") - public Optional getHvacModeSetting() { + public Optional getHvacModeSetting() { return hvacModeSetting; } @@ -159,7 +168,7 @@ public Optional getManualOverrideAllowed() { return manualOverrideAllowed; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClimateSettingSchedule && equalTo((ClimateSettingSchedule) other); @@ -177,6 +186,7 @@ private boolean equalTo(ClimateSettingSchedule other) { && scheduleStartsAt.equals(other.scheduleStartsAt) && scheduleEndsAt.equals(other.scheduleEndsAt) && createdAt.equals(other.createdAt) + && errors.equals(other.errors) && automaticHeatingEnabled.equals(other.automaticHeatingEnabled) && automaticCoolingEnabled.equals(other.automaticCoolingEnabled) && hvacModeSetting.equals(other.hvacModeSetting) @@ -187,7 +197,7 @@ private boolean equalTo(ClimateSettingSchedule other) { && manualOverrideAllowed.equals(other.manualOverrideAllowed); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.climateSettingScheduleId, @@ -196,6 +206,7 @@ public int hashCode() { this.scheduleStartsAt, this.scheduleEndsAt, this.createdAt, + this.errors, this.automaticHeatingEnabled, this.automaticCoolingEnabled, this.hvacModeSetting, @@ -206,7 +217,7 @@ public int hashCode() { this.manualOverrideAllowed); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -244,6 +255,10 @@ public interface _FinalStage { _FinalStage name(String name); + _FinalStage errors(Optional errors); + + _FinalStage errors(Object errors); + _FinalStage automaticHeatingEnabled(Optional automaticHeatingEnabled); _FinalStage automaticHeatingEnabled(Boolean automaticHeatingEnabled); @@ -252,9 +267,9 @@ public interface _FinalStage { _FinalStage automaticCoolingEnabled(Boolean automaticCoolingEnabled); - _FinalStage hvacModeSetting(Optional hvacModeSetting); + _FinalStage hvacModeSetting(Optional hvacModeSetting); - _FinalStage hvacModeSetting(HvacModeSetting hvacModeSetting); + _FinalStage hvacModeSetting(ClimateSettingScheduleHvacModeSetting hvacModeSetting); _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius); @@ -305,12 +320,14 @@ public static final class Builder private Optional coolingSetPointCelsius = Optional.empty(); - private Optional hvacModeSetting = Optional.empty(); + private Optional hvacModeSetting = Optional.empty(); private Optional automaticCoolingEnabled = Optional.empty(); private Optional automaticHeatingEnabled = Optional.empty(); + private Optional errors = Optional.empty(); + private Optional name = Optional.empty(); @JsonAnySetter @@ -318,7 +335,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ClimateSettingSchedule other) { climateSettingScheduleId(other.getClimateSettingScheduleId()); deviceId(other.getDeviceId()); @@ -326,6 +343,7 @@ public Builder from(ClimateSettingSchedule other) { scheduleStartsAt(other.getScheduleStartsAt()); scheduleEndsAt(other.getScheduleEndsAt()); createdAt(other.getCreatedAt()); + errors(other.getErrors()); automaticHeatingEnabled(other.getAutomaticHeatingEnabled()); automaticCoolingEnabled(other.getAutomaticCoolingEnabled()); hvacModeSetting(other.getHvacModeSetting()); @@ -337,159 +355,172 @@ public Builder from(ClimateSettingSchedule other) { return this; } - @Override + @java.lang.Override @JsonSetter("climate_setting_schedule_id") public DeviceIdStage climateSettingScheduleId(String climateSettingScheduleId) { this.climateSettingScheduleId = climateSettingScheduleId; return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public ScheduleStartsAtStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("schedule_starts_at") public ScheduleEndsAtStage scheduleStartsAt(String scheduleStartsAt) { this.scheduleStartsAt = scheduleStartsAt; return this; } - @Override + @java.lang.Override @JsonSetter("schedule_ends_at") public CreatedAtStage scheduleEndsAt(String scheduleEndsAt) { this.scheduleEndsAt = scheduleEndsAt; return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override public _FinalStage manualOverrideAllowed(Boolean manualOverrideAllowed) { this.manualOverrideAllowed = Optional.of(manualOverrideAllowed); return this; } - @Override + @java.lang.Override @JsonSetter(value = "manual_override_allowed", nulls = Nulls.SKIP) public _FinalStage manualOverrideAllowed(Optional manualOverrideAllowed) { this.manualOverrideAllowed = manualOverrideAllowed; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointFahrenheit(Double heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = Optional.of(heatingSetPointFahrenheit); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_fahrenheit", nulls = Nulls.SKIP) public _FinalStage heatingSetPointFahrenheit(Optional heatingSetPointFahrenheit) { this.heatingSetPointFahrenheit = heatingSetPointFahrenheit; return this; } - @Override + @java.lang.Override public _FinalStage coolingSetPointFahrenheit(Double coolingSetPointFahrenheit) { this.coolingSetPointFahrenheit = Optional.of(coolingSetPointFahrenheit); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cooling_set_point_fahrenheit", nulls = Nulls.SKIP) public _FinalStage coolingSetPointFahrenheit(Optional coolingSetPointFahrenheit) { this.coolingSetPointFahrenheit = coolingSetPointFahrenheit; return this; } - @Override + @java.lang.Override public _FinalStage heatingSetPointCelsius(Double heatingSetPointCelsius) { this.heatingSetPointCelsius = Optional.of(heatingSetPointCelsius); return this; } - @Override + @java.lang.Override @JsonSetter(value = "heating_set_point_celsius", nulls = Nulls.SKIP) public _FinalStage heatingSetPointCelsius(Optional heatingSetPointCelsius) { this.heatingSetPointCelsius = heatingSetPointCelsius; return this; } - @Override + @java.lang.Override public _FinalStage coolingSetPointCelsius(Double coolingSetPointCelsius) { this.coolingSetPointCelsius = Optional.of(coolingSetPointCelsius); return this; } - @Override + @java.lang.Override @JsonSetter(value = "cooling_set_point_celsius", nulls = Nulls.SKIP) public _FinalStage coolingSetPointCelsius(Optional coolingSetPointCelsius) { this.coolingSetPointCelsius = coolingSetPointCelsius; return this; } - @Override - public _FinalStage hvacModeSetting(HvacModeSetting hvacModeSetting) { + @java.lang.Override + public _FinalStage hvacModeSetting(ClimateSettingScheduleHvacModeSetting hvacModeSetting) { this.hvacModeSetting = Optional.of(hvacModeSetting); return this; } - @Override + @java.lang.Override @JsonSetter(value = "hvac_mode_setting", nulls = Nulls.SKIP) - public _FinalStage hvacModeSetting(Optional hvacModeSetting) { + public _FinalStage hvacModeSetting(Optional hvacModeSetting) { this.hvacModeSetting = hvacModeSetting; return this; } - @Override + @java.lang.Override public _FinalStage automaticCoolingEnabled(Boolean automaticCoolingEnabled) { this.automaticCoolingEnabled = Optional.of(automaticCoolingEnabled); return this; } - @Override + @java.lang.Override @JsonSetter(value = "automatic_cooling_enabled", nulls = Nulls.SKIP) public _FinalStage automaticCoolingEnabled(Optional automaticCoolingEnabled) { this.automaticCoolingEnabled = automaticCoolingEnabled; return this; } - @Override + @java.lang.Override public _FinalStage automaticHeatingEnabled(Boolean automaticHeatingEnabled) { this.automaticHeatingEnabled = Optional.of(automaticHeatingEnabled); return this; } - @Override + @java.lang.Override @JsonSetter(value = "automatic_heating_enabled", nulls = Nulls.SKIP) public _FinalStage automaticHeatingEnabled(Optional automaticHeatingEnabled) { this.automaticHeatingEnabled = automaticHeatingEnabled; return this; } - @Override + @java.lang.Override + public _FinalStage errors(Object errors) { + this.errors = Optional.of(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(Optional errors) { + this.errors = errors; + return this; + } + + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override + @java.lang.Override public ClimateSettingSchedule build() { return new ClimateSettingSchedule( climateSettingScheduleId, @@ -498,6 +529,7 @@ public ClimateSettingSchedule build() { scheduleStartsAt, scheduleEndsAt, createdAt, + errors, automaticHeatingEnabled, automaticCoolingEnabled, hvacModeSetting, diff --git a/src/main/java/com/seam/api/types/ClimateSettingScheduleHvacModeSetting.java b/src/main/java/com/seam/api/types/ClimateSettingScheduleHvacModeSetting.java new file mode 100644 index 0000000..fdc75b1 --- /dev/null +++ b/src/main/java/com/seam/api/types/ClimateSettingScheduleHvacModeSetting.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ClimateSettingScheduleHvacModeSetting { + OFF("off"), + + HEAT("heat"), + + COOL("cool"), + + HEAT_COOL("heat_cool"); + + private final String value; + + ClimateSettingScheduleHvacModeSetting(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/ConnectWebview.java b/src/main/java/com/seam/api/types/ConnectWebview.java index 9f821aa..f4c68cb 100644 --- a/src/main/java/com/seam/api/types/ConnectWebview.java +++ b/src/main/java/com/seam/api/types/ConnectWebview.java @@ -15,6 +15,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -25,56 +26,84 @@ public final class ConnectWebview { private final String connectWebviewId; + private final String workspaceId; + + private final OffsetDateTime createdAt; + private final Optional connectedAccountId; private final String url; - private final String workspaceId; - private final SelectionMode deviceSelectionMode; private final List acceptedProviders; private final List acceptedDevices; - private final boolean anyProviderAllowed; - private final boolean anyDeviceAllowed; - private final OffsetDateTime createdAt; + private final boolean anyProviderAllowed; private final boolean loginSuccessful; private final ConnectWebviewStatus status; + private final Optional customRedirectUrl; + + private final Optional customRedirectFailureUrl; + + private final Map customMetadata; + + private final boolean automaticallyManageNewDevices; + + private final boolean waitForDeviceCreation; + + private final Optional authorizedAt; + + private final Optional selectedProvider; + private final Map additionalProperties; private ConnectWebview( String connectWebviewId, + String workspaceId, + OffsetDateTime createdAt, Optional connectedAccountId, String url, - String workspaceId, SelectionMode deviceSelectionMode, List acceptedProviders, List acceptedDevices, - boolean anyProviderAllowed, boolean anyDeviceAllowed, - OffsetDateTime createdAt, + boolean anyProviderAllowed, boolean loginSuccessful, ConnectWebviewStatus status, + Optional customRedirectUrl, + Optional customRedirectFailureUrl, + Map customMetadata, + boolean automaticallyManageNewDevices, + boolean waitForDeviceCreation, + Optional authorizedAt, + Optional selectedProvider, Map additionalProperties) { this.connectWebviewId = connectWebviewId; + this.workspaceId = workspaceId; + this.createdAt = createdAt; this.connectedAccountId = connectedAccountId; this.url = url; - this.workspaceId = workspaceId; this.deviceSelectionMode = deviceSelectionMode; this.acceptedProviders = acceptedProviders; this.acceptedDevices = acceptedDevices; - this.anyProviderAllowed = anyProviderAllowed; this.anyDeviceAllowed = anyDeviceAllowed; - this.createdAt = createdAt; + this.anyProviderAllowed = anyProviderAllowed; this.loginSuccessful = loginSuccessful; this.status = status; + this.customRedirectUrl = customRedirectUrl; + this.customRedirectFailureUrl = customRedirectFailureUrl; + this.customMetadata = customMetadata; + this.automaticallyManageNewDevices = automaticallyManageNewDevices; + this.waitForDeviceCreation = waitForDeviceCreation; + this.authorizedAt = authorizedAt; + this.selectedProvider = selectedProvider; this.additionalProperties = additionalProperties; } @@ -83,6 +112,16 @@ public String getConnectWebviewId() { return connectWebviewId; } + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + @JsonProperty("connected_account_id") public Optional getConnectedAccountId() { return connectedAccountId; @@ -93,11 +132,6 @@ public String getUrl() { return url; } - @JsonProperty("workspace_id") - public String getWorkspaceId() { - return workspaceId; - } - @JsonProperty("device_selection_mode") public SelectionMode getDeviceSelectionMode() { return deviceSelectionMode; @@ -113,19 +147,14 @@ public List getAcceptedDevices() { return acceptedDevices; } - @JsonProperty("any_provider_allowed") - public boolean getAnyProviderAllowed() { - return anyProviderAllowed; - } - @JsonProperty("any_device_allowed") public boolean getAnyDeviceAllowed() { return anyDeviceAllowed; } - @JsonProperty("created_at") - public OffsetDateTime getCreatedAt() { - return createdAt; + @JsonProperty("any_provider_allowed") + public boolean getAnyProviderAllowed() { + return anyProviderAllowed; } @JsonProperty("login_successful") @@ -138,7 +167,42 @@ public ConnectWebviewStatus getStatus() { return status; } - @Override + @JsonProperty("custom_redirect_url") + public Optional getCustomRedirectUrl() { + return customRedirectUrl; + } + + @JsonProperty("custom_redirect_failure_url") + public Optional getCustomRedirectFailureUrl() { + return customRedirectFailureUrl; + } + + @JsonProperty("custom_metadata") + public Map getCustomMetadata() { + return customMetadata; + } + + @JsonProperty("automatically_manage_new_devices") + public boolean getAutomaticallyManageNewDevices() { + return automaticallyManageNewDevices; + } + + @JsonProperty("wait_for_device_creation") + public boolean getWaitForDeviceCreation() { + return waitForDeviceCreation; + } + + @JsonProperty("authorized_at") + public Optional getAuthorizedAt() { + return authorizedAt; + } + + @JsonProperty("selected_provider") + public Optional getSelectedProvider() { + return selectedProvider; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectWebview && equalTo((ConnectWebview) other); @@ -151,37 +215,51 @@ public Map getAdditionalProperties() { private boolean equalTo(ConnectWebview other) { return connectWebviewId.equals(other.connectWebviewId) + && workspaceId.equals(other.workspaceId) + && createdAt.equals(other.createdAt) && connectedAccountId.equals(other.connectedAccountId) && url.equals(other.url) - && workspaceId.equals(other.workspaceId) && deviceSelectionMode.equals(other.deviceSelectionMode) && acceptedProviders.equals(other.acceptedProviders) && acceptedDevices.equals(other.acceptedDevices) - && anyProviderAllowed == other.anyProviderAllowed && anyDeviceAllowed == other.anyDeviceAllowed - && createdAt.equals(other.createdAt) + && anyProviderAllowed == other.anyProviderAllowed && loginSuccessful == other.loginSuccessful - && status.equals(other.status); + && status.equals(other.status) + && customRedirectUrl.equals(other.customRedirectUrl) + && customRedirectFailureUrl.equals(other.customRedirectFailureUrl) + && customMetadata.equals(other.customMetadata) + && automaticallyManageNewDevices == other.automaticallyManageNewDevices + && waitForDeviceCreation == other.waitForDeviceCreation + && authorizedAt.equals(other.authorizedAt) + && selectedProvider.equals(other.selectedProvider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectWebviewId, + this.workspaceId, + this.createdAt, this.connectedAccountId, this.url, - this.workspaceId, this.deviceSelectionMode, this.acceptedProviders, this.acceptedDevices, - this.anyProviderAllowed, this.anyDeviceAllowed, - this.createdAt, + this.anyProviderAllowed, this.loginSuccessful, - this.status); + this.status, + this.customRedirectUrl, + this.customRedirectFailureUrl, + this.customMetadata, + this.automaticallyManageNewDevices, + this.waitForDeviceCreation, + this.authorizedAt, + this.selectedProvider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -191,33 +269,33 @@ public static ConnectWebviewIdStage builder() { } public interface ConnectWebviewIdStage { - UrlStage connectWebviewId(String connectWebviewId); + WorkspaceIdStage connectWebviewId(String connectWebviewId); Builder from(ConnectWebview other); } - public interface UrlStage { - WorkspaceIdStage url(String url); + public interface WorkspaceIdStage { + CreatedAtStage workspaceId(String workspaceId); } - public interface WorkspaceIdStage { - DeviceSelectionModeStage workspaceId(String workspaceId); + public interface CreatedAtStage { + UrlStage createdAt(OffsetDateTime createdAt); } - public interface DeviceSelectionModeStage { - AnyProviderAllowedStage deviceSelectionMode(SelectionMode deviceSelectionMode); + public interface UrlStage { + DeviceSelectionModeStage url(String url); } - public interface AnyProviderAllowedStage { - AnyDeviceAllowedStage anyProviderAllowed(boolean anyProviderAllowed); + public interface DeviceSelectionModeStage { + AnyDeviceAllowedStage deviceSelectionMode(SelectionMode deviceSelectionMode); } public interface AnyDeviceAllowedStage { - CreatedAtStage anyDeviceAllowed(boolean anyDeviceAllowed); + AnyProviderAllowedStage anyDeviceAllowed(boolean anyDeviceAllowed); } - public interface CreatedAtStage { - LoginSuccessfulStage createdAt(OffsetDateTime createdAt); + public interface AnyProviderAllowedStage { + LoginSuccessfulStage anyProviderAllowed(boolean anyProviderAllowed); } public interface LoginSuccessfulStage { @@ -225,7 +303,15 @@ public interface LoginSuccessfulStage { } public interface StatusStage { - _FinalStage status(ConnectWebviewStatus status); + AutomaticallyManageNewDevicesStage status(ConnectWebviewStatus status); + } + + public interface AutomaticallyManageNewDevicesStage { + WaitForDeviceCreationStage automaticallyManageNewDevices(boolean automaticallyManageNewDevices); + } + + public interface WaitForDeviceCreationStage { + _FinalStage waitForDeviceCreation(boolean waitForDeviceCreation); } public interface _FinalStage { @@ -246,38 +332,76 @@ public interface _FinalStage { _FinalStage addAcceptedDevices(String acceptedDevices); _FinalStage addAllAcceptedDevices(List acceptedDevices); + + _FinalStage customRedirectUrl(Optional customRedirectUrl); + + _FinalStage customRedirectUrl(String customRedirectUrl); + + _FinalStage customRedirectFailureUrl(Optional customRedirectFailureUrl); + + _FinalStage customRedirectFailureUrl(String customRedirectFailureUrl); + + _FinalStage customMetadata(Map customMetadata); + + _FinalStage putAllCustomMetadata(Map customMetadata); + + _FinalStage customMetadata(String key, ConnectWebviewCustomMetadataValue value); + + _FinalStage authorizedAt(Optional authorizedAt); + + _FinalStage authorizedAt(OffsetDateTime authorizedAt); + + _FinalStage selectedProvider(Optional selectedProvider); + + _FinalStage selectedProvider(String selectedProvider); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ConnectWebviewIdStage, - UrlStage, WorkspaceIdStage, + CreatedAtStage, + UrlStage, DeviceSelectionModeStage, - AnyProviderAllowedStage, AnyDeviceAllowedStage, - CreatedAtStage, + AnyProviderAllowedStage, LoginSuccessfulStage, StatusStage, + AutomaticallyManageNewDevicesStage, + WaitForDeviceCreationStage, _FinalStage { private String connectWebviewId; - private String url; - private String workspaceId; - private SelectionMode deviceSelectionMode; + private OffsetDateTime createdAt; - private boolean anyProviderAllowed; + private String url; + + private SelectionMode deviceSelectionMode; private boolean anyDeviceAllowed; - private OffsetDateTime createdAt; + private boolean anyProviderAllowed; private boolean loginSuccessful; private ConnectWebviewStatus status; + private boolean automaticallyManageNewDevices; + + private boolean waitForDeviceCreation; + + private Optional selectedProvider = Optional.empty(); + + private Optional authorizedAt = Optional.empty(); + + private Map customMetadata = new LinkedHashMap<>(); + + private Optional customRedirectFailureUrl = Optional.empty(); + + private Optional customRedirectUrl = Optional.empty(); + private List acceptedDevices = new ArrayList<>(); private List acceptedProviders = new ArrayList<>(); @@ -289,99 +413,192 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(ConnectWebview other) { connectWebviewId(other.getConnectWebviewId()); + workspaceId(other.getWorkspaceId()); + createdAt(other.getCreatedAt()); connectedAccountId(other.getConnectedAccountId()); url(other.getUrl()); - workspaceId(other.getWorkspaceId()); deviceSelectionMode(other.getDeviceSelectionMode()); acceptedProviders(other.getAcceptedProviders()); acceptedDevices(other.getAcceptedDevices()); - anyProviderAllowed(other.getAnyProviderAllowed()); anyDeviceAllowed(other.getAnyDeviceAllowed()); - createdAt(other.getCreatedAt()); + anyProviderAllowed(other.getAnyProviderAllowed()); loginSuccessful(other.getLoginSuccessful()); status(other.getStatus()); + customRedirectUrl(other.getCustomRedirectUrl()); + customRedirectFailureUrl(other.getCustomRedirectFailureUrl()); + customMetadata(other.getCustomMetadata()); + automaticallyManageNewDevices(other.getAutomaticallyManageNewDevices()); + waitForDeviceCreation(other.getWaitForDeviceCreation()); + authorizedAt(other.getAuthorizedAt()); + selectedProvider(other.getSelectedProvider()); return this; } - @Override + @java.lang.Override @JsonSetter("connect_webview_id") - public UrlStage connectWebviewId(String connectWebviewId) { + public WorkspaceIdStage connectWebviewId(String connectWebviewId) { this.connectWebviewId = connectWebviewId; return this; } - @Override - @JsonSetter("url") - public WorkspaceIdStage url(String url) { - this.url = url; + @java.lang.Override + @JsonSetter("workspace_id") + public CreatedAtStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; return this; } - @Override - @JsonSetter("workspace_id") - public DeviceSelectionModeStage workspaceId(String workspaceId) { - this.workspaceId = workspaceId; + @java.lang.Override + @JsonSetter("created_at") + public UrlStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; return this; } - @Override - @JsonSetter("device_selection_mode") - public AnyProviderAllowedStage deviceSelectionMode(SelectionMode deviceSelectionMode) { - this.deviceSelectionMode = deviceSelectionMode; + @java.lang.Override + @JsonSetter("url") + public DeviceSelectionModeStage url(String url) { + this.url = url; return this; } - @Override - @JsonSetter("any_provider_allowed") - public AnyDeviceAllowedStage anyProviderAllowed(boolean anyProviderAllowed) { - this.anyProviderAllowed = anyProviderAllowed; + @java.lang.Override + @JsonSetter("device_selection_mode") + public AnyDeviceAllowedStage deviceSelectionMode(SelectionMode deviceSelectionMode) { + this.deviceSelectionMode = deviceSelectionMode; return this; } - @Override + @java.lang.Override @JsonSetter("any_device_allowed") - public CreatedAtStage anyDeviceAllowed(boolean anyDeviceAllowed) { + public AnyProviderAllowedStage anyDeviceAllowed(boolean anyDeviceAllowed) { this.anyDeviceAllowed = anyDeviceAllowed; return this; } - @Override - @JsonSetter("created_at") - public LoginSuccessfulStage createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; + @java.lang.Override + @JsonSetter("any_provider_allowed") + public LoginSuccessfulStage anyProviderAllowed(boolean anyProviderAllowed) { + this.anyProviderAllowed = anyProviderAllowed; return this; } - @Override + @java.lang.Override @JsonSetter("login_successful") public StatusStage loginSuccessful(boolean loginSuccessful) { this.loginSuccessful = loginSuccessful; return this; } - @Override + @java.lang.Override @JsonSetter("status") - public _FinalStage status(ConnectWebviewStatus status) { + public AutomaticallyManageNewDevicesStage status(ConnectWebviewStatus status) { this.status = status; return this; } - @Override + @java.lang.Override + @JsonSetter("automatically_manage_new_devices") + public WaitForDeviceCreationStage automaticallyManageNewDevices(boolean automaticallyManageNewDevices) { + this.automaticallyManageNewDevices = automaticallyManageNewDevices; + return this; + } + + @java.lang.Override + @JsonSetter("wait_for_device_creation") + public _FinalStage waitForDeviceCreation(boolean waitForDeviceCreation) { + this.waitForDeviceCreation = waitForDeviceCreation; + return this; + } + + @java.lang.Override + public _FinalStage selectedProvider(String selectedProvider) { + this.selectedProvider = Optional.of(selectedProvider); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selected_provider", nulls = Nulls.SKIP) + public _FinalStage selectedProvider(Optional selectedProvider) { + this.selectedProvider = selectedProvider; + return this; + } + + @java.lang.Override + public _FinalStage authorizedAt(OffsetDateTime authorizedAt) { + this.authorizedAt = Optional.of(authorizedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "authorized_at", nulls = Nulls.SKIP) + public _FinalStage authorizedAt(Optional authorizedAt) { + this.authorizedAt = authorizedAt; + return this; + } + + @java.lang.Override + public _FinalStage customMetadata(String key, ConnectWebviewCustomMetadataValue value) { + this.customMetadata.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllCustomMetadata(Map customMetadata) { + this.customMetadata.putAll(customMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) + public _FinalStage customMetadata(Map customMetadata) { + this.customMetadata.clear(); + this.customMetadata.putAll(customMetadata); + return this; + } + + @java.lang.Override + public _FinalStage customRedirectFailureUrl(String customRedirectFailureUrl) { + this.customRedirectFailureUrl = Optional.of(customRedirectFailureUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_redirect_failure_url", nulls = Nulls.SKIP) + public _FinalStage customRedirectFailureUrl(Optional customRedirectFailureUrl) { + this.customRedirectFailureUrl = customRedirectFailureUrl; + return this; + } + + @java.lang.Override + public _FinalStage customRedirectUrl(String customRedirectUrl) { + this.customRedirectUrl = Optional.of(customRedirectUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_redirect_url", nulls = Nulls.SKIP) + public _FinalStage customRedirectUrl(Optional customRedirectUrl) { + this.customRedirectUrl = customRedirectUrl; + return this; + } + + @java.lang.Override public _FinalStage addAllAcceptedDevices(List acceptedDevices) { this.acceptedDevices.addAll(acceptedDevices); return this; } - @Override + @java.lang.Override public _FinalStage addAcceptedDevices(String acceptedDevices) { this.acceptedDevices.add(acceptedDevices); return this; } - @Override + @java.lang.Override @JsonSetter(value = "accepted_devices", nulls = Nulls.SKIP) public _FinalStage acceptedDevices(List acceptedDevices) { this.acceptedDevices.clear(); @@ -389,19 +606,19 @@ public _FinalStage acceptedDevices(List acceptedDevices) { return this; } - @Override + @java.lang.Override public _FinalStage addAllAcceptedProviders(List acceptedProviders) { this.acceptedProviders.addAll(acceptedProviders); return this; } - @Override + @java.lang.Override public _FinalStage addAcceptedProviders(String acceptedProviders) { this.acceptedProviders.add(acceptedProviders); return this; } - @Override + @java.lang.Override @JsonSetter(value = "accepted_providers", nulls = Nulls.SKIP) public _FinalStage acceptedProviders(List acceptedProviders) { this.acceptedProviders.clear(); @@ -409,34 +626,41 @@ public _FinalStage acceptedProviders(List acceptedProviders) { return this; } - @Override + @java.lang.Override public _FinalStage connectedAccountId(String connectedAccountId) { this.connectedAccountId = Optional.of(connectedAccountId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connected_account_id", nulls = Nulls.SKIP) public _FinalStage connectedAccountId(Optional connectedAccountId) { this.connectedAccountId = connectedAccountId; return this; } - @Override + @java.lang.Override public ConnectWebview build() { return new ConnectWebview( connectWebviewId, + workspaceId, + createdAt, connectedAccountId, url, - workspaceId, deviceSelectionMode, acceptedProviders, acceptedDevices, - anyProviderAllowed, anyDeviceAllowed, - createdAt, + anyProviderAllowed, loginSuccessful, status, + customRedirectUrl, + customRedirectFailureUrl, + customMetadata, + automaticallyManageNewDevices, + waitForDeviceCreation, + authorizedAt, + selectedProvider, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/CustomMetadataValue.java b/src/main/java/com/seam/api/types/ConnectWebviewCustomMetadataValue.java similarity index 56% rename from src/main/java/com/seam/api/types/CustomMetadataValue.java rename to src/main/java/com/seam/api/types/ConnectWebviewCustomMetadataValue.java index 3617776..063fcb3 100644 --- a/src/main/java/com/seam/api/types/CustomMetadataValue.java +++ b/src/main/java/com/seam/api/types/ConnectWebviewCustomMetadataValue.java @@ -6,22 +6,20 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.seam.api.core.ObjectMappers; import java.io.IOException; import java.util.Objects; -import java.util.Optional; -@JsonDeserialize(using = CustomMetadataValue.Deserializer.class) -public final class CustomMetadataValue { +@JsonDeserialize(using = ConnectWebviewCustomMetadataValue.Deserializer.class) +public final class ConnectWebviewCustomMetadataValue { private final Object value; private final int type; - private CustomMetadataValue(Object value, int type) { + private ConnectWebviewCustomMetadataValue(Object value, int type) { this.value = value; this.type = type; } @@ -33,70 +31,60 @@ public Object get() { public T visit(Visitor visitor) { if (this.type == 0) { - return visitor.visit((Optional) this.value); + return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((double) this.value); - } else if (this.type == 2) { return visitor.visit((boolean) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof CustomMetadataValue && equalTo((CustomMetadataValue) other); + return other instanceof ConnectWebviewCustomMetadataValue && equalTo((ConnectWebviewCustomMetadataValue) other); } - private boolean equalTo(CustomMetadataValue other) { + private boolean equalTo(ConnectWebviewCustomMetadataValue other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } - public static CustomMetadataValue of(Optional value) { - return new CustomMetadataValue(value, 0); + public static ConnectWebviewCustomMetadataValue of(String value) { + return new ConnectWebviewCustomMetadataValue(value, 0); } - public static CustomMetadataValue of(double value) { - return new CustomMetadataValue(value, 1); - } - - public static CustomMetadataValue of(boolean value) { - return new CustomMetadataValue(value, 2); + public static ConnectWebviewCustomMetadataValue of(boolean value) { + return new ConnectWebviewCustomMetadataValue(value, 1); } public interface Visitor { - T visit(Optional value); - - T visit(double value); + T visit(String value); T visit(boolean value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(CustomMetadataValue.class); + super(ConnectWebviewCustomMetadataValue.class); } - @Override - public CustomMetadataValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + @java.lang.Override + public ConnectWebviewCustomMetadataValue deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { Object value = p.readValueAs(Object.class); try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (IllegalArgumentException e) { } - if (value instanceof Double) { - return of((Double) value); - } if (value instanceof Boolean) { return of((Boolean) value); } diff --git a/src/main/java/com/seam/api/types/ConnectWebviewStatus.java b/src/main/java/com/seam/api/types/ConnectWebviewStatus.java index b7cb1aa..6cb0c93 100644 --- a/src/main/java/com/seam/api/types/ConnectWebviewStatus.java +++ b/src/main/java/com/seam/api/types/ConnectWebviewStatus.java @@ -19,7 +19,7 @@ public enum ConnectWebviewStatus { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/ConnectedAccount.java b/src/main/java/com/seam/api/types/ConnectedAccount.java index 0d0a6f9..4b9c3fa 100644 --- a/src/main/java/com/seam/api/types/ConnectedAccount.java +++ b/src/main/java/com/seam/api/types/ConnectedAccount.java @@ -14,6 +14,7 @@ import com.seam.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -29,11 +30,15 @@ public final class ConnectedAccount { private final Optional accountType; + private final String accountTypeDisplayName; + private final Optional errors; private final Optional warnings; - private final Optional>> customMetadata; + private final Map customMetadata; + + private final boolean automaticallyManageNewDevices; private final Map additionalProperties; @@ -42,17 +47,21 @@ private ConnectedAccount( Optional createdAt, Optional userIdentifier, Optional accountType, + String accountTypeDisplayName, Optional errors, Optional warnings, - Optional>> customMetadata, + Map customMetadata, + boolean automaticallyManageNewDevices, Map additionalProperties) { this.connectedAccountId = connectedAccountId; this.createdAt = createdAt; this.userIdentifier = userIdentifier; this.accountType = accountType; + this.accountTypeDisplayName = accountTypeDisplayName; this.errors = errors; this.warnings = warnings; this.customMetadata = customMetadata; + this.automaticallyManageNewDevices = automaticallyManageNewDevices; this.additionalProperties = additionalProperties; } @@ -76,6 +85,11 @@ public Optional getAccountType() { return accountType; } + @JsonProperty("account_type_display_name") + public String getAccountTypeDisplayName() { + return accountTypeDisplayName; + } + @JsonProperty("errors") public Optional getErrors() { return errors; @@ -87,11 +101,16 @@ public Optional getWarnings() { } @JsonProperty("custom_metadata") - public Optional>> getCustomMetadata() { + public Map getCustomMetadata() { return customMetadata; } - @Override + @JsonProperty("automatically_manage_new_devices") + public boolean getAutomaticallyManageNewDevices() { + return automaticallyManageNewDevices; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccount && equalTo((ConnectedAccount) other); @@ -107,151 +126,244 @@ private boolean equalTo(ConnectedAccount other) { && createdAt.equals(other.createdAt) && userIdentifier.equals(other.userIdentifier) && accountType.equals(other.accountType) + && accountTypeDisplayName.equals(other.accountTypeDisplayName) && errors.equals(other.errors) && warnings.equals(other.warnings) - && customMetadata.equals(other.customMetadata); + && customMetadata.equals(other.customMetadata) + && automaticallyManageNewDevices == other.automaticallyManageNewDevices; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.connectedAccountId, this.createdAt, this.userIdentifier, this.accountType, + this.accountTypeDisplayName, this.errors, this.warnings, - this.customMetadata); + this.customMetadata, + this.automaticallyManageNewDevices); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } - public static Builder builder() { + public static AccountTypeDisplayNameStage builder() { return new Builder(); } + public interface AccountTypeDisplayNameStage { + AutomaticallyManageNewDevicesStage accountTypeDisplayName(String accountTypeDisplayName); + + Builder from(ConnectedAccount other); + } + + public interface AutomaticallyManageNewDevicesStage { + _FinalStage automaticallyManageNewDevices(boolean automaticallyManageNewDevices); + } + + public interface _FinalStage { + ConnectedAccount build(); + + _FinalStage connectedAccountId(Optional connectedAccountId); + + _FinalStage connectedAccountId(String connectedAccountId); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + _FinalStage userIdentifier(Optional userIdentifier); + + _FinalStage userIdentifier(ConnectedAccountUserIdentifier userIdentifier); + + _FinalStage accountType(Optional accountType); + + _FinalStage accountType(String accountType); + + _FinalStage errors(Optional errors); + + _FinalStage errors(Object errors); + + _FinalStage warnings(Optional warnings); + + _FinalStage warnings(Object warnings); + + _FinalStage customMetadata(Map customMetadata); + + _FinalStage putAllCustomMetadata(Map customMetadata); + + _FinalStage customMetadata(String key, ConnectedAccountCustomMetadataValue value); + } + @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional connectedAccountId = Optional.empty(); + public static final class Builder + implements AccountTypeDisplayNameStage, AutomaticallyManageNewDevicesStage, _FinalStage { + private String accountTypeDisplayName; - private Optional createdAt = Optional.empty(); + private boolean automaticallyManageNewDevices; - private Optional userIdentifier = Optional.empty(); + private Map customMetadata = new LinkedHashMap<>(); - private Optional accountType = Optional.empty(); + private Optional warnings = Optional.empty(); private Optional errors = Optional.empty(); - private Optional warnings = Optional.empty(); + private Optional accountType = Optional.empty(); + + private Optional userIdentifier = Optional.empty(); - private Optional>> customMetadata = Optional.empty(); + private Optional createdAt = Optional.empty(); + + private Optional connectedAccountId = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} + @java.lang.Override public Builder from(ConnectedAccount other) { connectedAccountId(other.getConnectedAccountId()); createdAt(other.getCreatedAt()); userIdentifier(other.getUserIdentifier()); accountType(other.getAccountType()); + accountTypeDisplayName(other.getAccountTypeDisplayName()); errors(other.getErrors()); warnings(other.getWarnings()); customMetadata(other.getCustomMetadata()); + automaticallyManageNewDevices(other.getAutomaticallyManageNewDevices()); return this; } - @JsonSetter(value = "connected_account_id", nulls = Nulls.SKIP) - public Builder connectedAccountId(Optional connectedAccountId) { - this.connectedAccountId = connectedAccountId; + @java.lang.Override + @JsonSetter("account_type_display_name") + public AutomaticallyManageNewDevicesStage accountTypeDisplayName(String accountTypeDisplayName) { + this.accountTypeDisplayName = accountTypeDisplayName; return this; } - public Builder connectedAccountId(String connectedAccountId) { - this.connectedAccountId = Optional.of(connectedAccountId); + @java.lang.Override + @JsonSetter("automatically_manage_new_devices") + public _FinalStage automaticallyManageNewDevices(boolean automaticallyManageNewDevices) { + this.automaticallyManageNewDevices = automaticallyManageNewDevices; return this; } - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; + @java.lang.Override + public _FinalStage customMetadata(String key, ConnectedAccountCustomMetadataValue value) { + this.customMetadata.put(key, value); return this; } - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.of(createdAt); + @java.lang.Override + public _FinalStage putAllCustomMetadata(Map customMetadata) { + this.customMetadata.putAll(customMetadata); return this; } - @JsonSetter(value = "user_identifier", nulls = Nulls.SKIP) - public Builder userIdentifier(Optional userIdentifier) { - this.userIdentifier = userIdentifier; + @java.lang.Override + @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) + public _FinalStage customMetadata(Map customMetadata) { + this.customMetadata.clear(); + this.customMetadata.putAll(customMetadata); return this; } - public Builder userIdentifier(ConnectedAccountUserIdentifier userIdentifier) { - this.userIdentifier = Optional.of(userIdentifier); + @java.lang.Override + public _FinalStage warnings(Object warnings) { + this.warnings = Optional.of(warnings); return this; } - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(Optional warnings) { + this.warnings = warnings; return this; } - public Builder accountType(String accountType) { - this.accountType = Optional.of(accountType); + @java.lang.Override + public _FinalStage errors(Object errors) { + this.errors = Optional.of(errors); return this; } + @java.lang.Override @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public Builder errors(Optional errors) { + public _FinalStage errors(Optional errors) { this.errors = errors; return this; } - public Builder errors(Object errors) { - this.errors = Optional.of(errors); + @java.lang.Override + public _FinalStage accountType(String accountType) { + this.accountType = Optional.of(accountType); return this; } - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public Builder warnings(Optional warnings) { - this.warnings = warnings; + @java.lang.Override + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public _FinalStage accountType(Optional accountType) { + this.accountType = accountType; return this; } - public Builder warnings(Object warnings) { - this.warnings = Optional.of(warnings); + @java.lang.Override + public _FinalStage userIdentifier(ConnectedAccountUserIdentifier userIdentifier) { + this.userIdentifier = Optional.of(userIdentifier); return this; } - @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) - public Builder customMetadata( - Optional>> customMetadata) { - this.customMetadata = customMetadata; + @java.lang.Override + @JsonSetter(value = "user_identifier", nulls = Nulls.SKIP) + public _FinalStage userIdentifier(Optional userIdentifier) { + this.userIdentifier = userIdentifier; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.of(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public _FinalStage connectedAccountId(String connectedAccountId) { + this.connectedAccountId = Optional.of(connectedAccountId); return this; } - public Builder customMetadata(Map> customMetadata) { - this.customMetadata = Optional.of(customMetadata); + @java.lang.Override + @JsonSetter(value = "connected_account_id", nulls = Nulls.SKIP) + public _FinalStage connectedAccountId(Optional connectedAccountId) { + this.connectedAccountId = connectedAccountId; return this; } + @java.lang.Override public ConnectedAccount build() { return new ConnectedAccount( connectedAccountId, createdAt, userIdentifier, accountType, + accountTypeDisplayName, errors, warnings, customMetadata, + automaticallyManageNewDevices, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/ConnectedAccountCustomMetadataValue.java b/src/main/java/com/seam/api/types/ConnectedAccountCustomMetadataValue.java index 494cdf5..a27d3a6 100644 --- a/src/main/java/com/seam/api/types/ConnectedAccountCustomMetadataValue.java +++ b/src/main/java/com/seam/api/types/ConnectedAccountCustomMetadataValue.java @@ -6,14 +6,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.seam.api.core.ObjectMappers; import java.io.IOException; import java.util.Objects; -import java.util.Optional; @JsonDeserialize(using = ConnectedAccountCustomMetadataValue.Deserializer.class) public final class ConnectedAccountCustomMetadataValue { @@ -35,16 +33,12 @@ public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((double) this.value); - } else if (this.type == 2) { return visitor.visit((boolean) this.value); - } else if (this.type == 3) { - return visitor.visit((Optional) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccountCustomMetadataValue @@ -55,12 +49,12 @@ private boolean equalTo(ConnectedAccountCustomMetadataValue other) { return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { return this.value.toString(); } @@ -69,26 +63,14 @@ public static ConnectedAccountCustomMetadataValue of(String value) { return new ConnectedAccountCustomMetadataValue(value, 0); } - public static ConnectedAccountCustomMetadataValue of(double value) { - return new ConnectedAccountCustomMetadataValue(value, 1); - } - public static ConnectedAccountCustomMetadataValue of(boolean value) { - return new ConnectedAccountCustomMetadataValue(value, 2); - } - - public static ConnectedAccountCustomMetadataValue of(Optional value) { - return new ConnectedAccountCustomMetadataValue(value, 3); + return new ConnectedAccountCustomMetadataValue(value, 1); } public interface Visitor { T visit(String value); - T visit(double value); - T visit(boolean value); - - T visit(Optional value); } static final class Deserializer extends StdDeserializer { @@ -96,7 +78,7 @@ static final class Deserializer extends StdDeserializer>() {})); - } catch (IllegalArgumentException e) { - } throw new JsonParseException(p, "Failed to deserialize"); } } diff --git a/src/main/java/com/seam/api/types/ConnectedAccountUserIdentifier.java b/src/main/java/com/seam/api/types/ConnectedAccountUserIdentifier.java index bc5d569..329c0d9 100644 --- a/src/main/java/com/seam/api/types/ConnectedAccountUserIdentifier.java +++ b/src/main/java/com/seam/api/types/ConnectedAccountUserIdentifier.java @@ -72,7 +72,7 @@ public Optional getExclusive() { return exclusive; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ConnectedAccountUserIdentifier && equalTo((ConnectedAccountUserIdentifier) other); @@ -91,12 +91,12 @@ private boolean equalTo(ConnectedAccountUserIdentifier other) { && exclusive.equals(other.exclusive); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.username, this.apiUrl, this.email, this.phone, this.exclusive); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } diff --git a/src/main/java/com/seam/api/types/Device.java b/src/main/java/com/seam/api/types/Device.java index 34a26df..8fad716 100644 --- a/src/main/java/com/seam/api/types/Device.java +++ b/src/main/java/com/seam/api/types/Device.java @@ -15,6 +15,7 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -27,11 +28,15 @@ public final class Device { private final DeviceType deviceType; + private final Optional nickname; + + private final String displayName; + private final List capabilitiesSupported; private final DeviceProperties properties; - private final Optional location; + private final Optional location; private final String connectedAccountId; @@ -45,23 +50,51 @@ public final class Device { private final boolean isManaged; + private final Map customMetadata; + + private final Optional canRemotelyUnlock; + + private final Optional canRemotelyLock; + + private final Optional canProgramOfflineAccessCodes; + + private final Optional canProgramOnlineAccessCodes; + + private final Optional canSimulateRemoval; + + private final Optional canSimulateConnection; + + private final Optional canSimulateDisconnection; + private final Map additionalProperties; private Device( String deviceId, DeviceType deviceType, + Optional nickname, + String displayName, List capabilitiesSupported, DeviceProperties properties, - Optional location, + Optional location, String connectedAccountId, String workspaceId, List errors, List warnings, OffsetDateTime createdAt, boolean isManaged, + Map customMetadata, + Optional canRemotelyUnlock, + Optional canRemotelyLock, + Optional canProgramOfflineAccessCodes, + Optional canProgramOnlineAccessCodes, + Optional canSimulateRemoval, + Optional canSimulateConnection, + Optional canSimulateDisconnection, Map additionalProperties) { this.deviceId = deviceId; this.deviceType = deviceType; + this.nickname = nickname; + this.displayName = displayName; this.capabilitiesSupported = capabilitiesSupported; this.properties = properties; this.location = location; @@ -71,65 +104,162 @@ private Device( this.warnings = warnings; this.createdAt = createdAt; this.isManaged = isManaged; + this.customMetadata = customMetadata; + this.canRemotelyUnlock = canRemotelyUnlock; + this.canRemotelyLock = canRemotelyLock; + this.canProgramOfflineAccessCodes = canProgramOfflineAccessCodes; + this.canProgramOnlineAccessCodes = canProgramOnlineAccessCodes; + this.canSimulateRemoval = canSimulateRemoval; + this.canSimulateConnection = canSimulateConnection; + this.canSimulateDisconnection = canSimulateDisconnection; this.additionalProperties = additionalProperties; } + /** + * @return Unique identifier for the device. + */ @JsonProperty("device_id") public String getDeviceId() { return deviceId; } + /** + * @return Type of the device. + */ @JsonProperty("device_type") public DeviceType getDeviceType() { return deviceType; } + /** + * @return Optional nickname to describe the device, settable through Seam + */ + @JsonProperty("nickname") + public Optional getNickname() { + return nickname; + } + + /** + * @return Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + */ + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + /** + * @return Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health. + */ @JsonProperty("capabilities_supported") public List getCapabilitiesSupported() { return capabilitiesSupported; } + /** + * @return Properties of the device. + */ @JsonProperty("properties") public DeviceProperties getProperties() { return properties; } + /** + * @return Location information for the device. + */ @JsonProperty("location") - public Optional getLocation() { + public Optional getLocation() { return location; } + /** + * @return Unique identifier for the account associated with the device. + */ @JsonProperty("connected_account_id") public String getConnectedAccountId() { return connectedAccountId; } + /** + * @return Unique identifier for the Seam workspace associated with the device. + */ @JsonProperty("workspace_id") public String getWorkspaceId() { return workspaceId; } + /** + * @return Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + */ @JsonProperty("errors") public List getErrors() { return errors; } + /** + * @return Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + */ @JsonProperty("warnings") public List getWarnings() { return warnings; } + /** + * @return Date and time at which the device object was created. + */ @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; } + /** + * @return Indicates whether Seam manages the device. + */ @JsonProperty("is_managed") public boolean getIsManaged() { return isManaged; } - @Override + @JsonProperty("custom_metadata") + public Map getCustomMetadata() { + return customMetadata; + } + + @JsonProperty("can_remotely_unlock") + public Optional getCanRemotelyUnlock() { + return canRemotelyUnlock; + } + + @JsonProperty("can_remotely_lock") + public Optional getCanRemotelyLock() { + return canRemotelyLock; + } + + @JsonProperty("can_program_offline_access_codes") + public Optional getCanProgramOfflineAccessCodes() { + return canProgramOfflineAccessCodes; + } + + @JsonProperty("can_program_online_access_codes") + public Optional getCanProgramOnlineAccessCodes() { + return canProgramOnlineAccessCodes; + } + + @JsonProperty("can_simulate_removal") + public Optional getCanSimulateRemoval() { + return canSimulateRemoval; + } + + @JsonProperty("can_simulate_connection") + public Optional getCanSimulateConnection() { + return canSimulateConnection; + } + + @JsonProperty("can_simulate_disconnection") + public Optional getCanSimulateDisconnection() { + return canSimulateDisconnection; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Device && equalTo((Device) other); @@ -143,6 +273,8 @@ public Map getAdditionalProperties() { private boolean equalTo(Device other) { return deviceId.equals(other.deviceId) && deviceType.equals(other.deviceType) + && nickname.equals(other.nickname) + && displayName.equals(other.displayName) && capabilitiesSupported.equals(other.capabilitiesSupported) && properties.equals(other.properties) && location.equals(other.location) @@ -151,14 +283,24 @@ private boolean equalTo(Device other) { && errors.equals(other.errors) && warnings.equals(other.warnings) && createdAt.equals(other.createdAt) - && isManaged == other.isManaged; + && isManaged == other.isManaged + && customMetadata.equals(other.customMetadata) + && canRemotelyUnlock.equals(other.canRemotelyUnlock) + && canRemotelyLock.equals(other.canRemotelyLock) + && canProgramOfflineAccessCodes.equals(other.canProgramOfflineAccessCodes) + && canProgramOnlineAccessCodes.equals(other.canProgramOnlineAccessCodes) + && canSimulateRemoval.equals(other.canSimulateRemoval) + && canSimulateConnection.equals(other.canSimulateConnection) + && canSimulateDisconnection.equals(other.canSimulateDisconnection); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.deviceId, this.deviceType, + this.nickname, + this.displayName, this.capabilitiesSupported, this.properties, this.location, @@ -167,10 +309,18 @@ public int hashCode() { this.errors, this.warnings, this.createdAt, - this.isManaged); + this.isManaged, + this.customMetadata, + this.canRemotelyUnlock, + this.canRemotelyLock, + this.canProgramOfflineAccessCodes, + this.canProgramOnlineAccessCodes, + this.canSimulateRemoval, + this.canSimulateConnection, + this.canSimulateDisconnection); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -186,7 +336,11 @@ public interface DeviceIdStage { } public interface DeviceTypeStage { - PropertiesStage deviceType(DeviceType deviceType); + DisplayNameStage deviceType(DeviceType deviceType); + } + + public interface DisplayNameStage { + PropertiesStage displayName(String displayName); } public interface PropertiesStage { @@ -212,15 +366,19 @@ public interface IsManagedStage { public interface _FinalStage { Device build(); + _FinalStage nickname(Optional nickname); + + _FinalStage nickname(String nickname); + _FinalStage capabilitiesSupported(List capabilitiesSupported); _FinalStage addCapabilitiesSupported(DeviceCapabilitiesSupportedItem capabilitiesSupported); _FinalStage addAllCapabilitiesSupported(List capabilitiesSupported); - _FinalStage location(Optional location); + _FinalStage location(Optional location); - _FinalStage location(Object location); + _FinalStage location(DeviceLocation location); _FinalStage errors(List errors); @@ -233,12 +391,47 @@ public interface _FinalStage { _FinalStage addWarnings(DeviceWarningsItem warnings); _FinalStage addAllWarnings(List warnings); + + _FinalStage customMetadata(Map customMetadata); + + _FinalStage putAllCustomMetadata(Map customMetadata); + + _FinalStage customMetadata(String key, DeviceCustomMetadataValue value); + + _FinalStage canRemotelyUnlock(Optional canRemotelyUnlock); + + _FinalStage canRemotelyUnlock(Boolean canRemotelyUnlock); + + _FinalStage canRemotelyLock(Optional canRemotelyLock); + + _FinalStage canRemotelyLock(Boolean canRemotelyLock); + + _FinalStage canProgramOfflineAccessCodes(Optional canProgramOfflineAccessCodes); + + _FinalStage canProgramOfflineAccessCodes(Boolean canProgramOfflineAccessCodes); + + _FinalStage canProgramOnlineAccessCodes(Optional canProgramOnlineAccessCodes); + + _FinalStage canProgramOnlineAccessCodes(Boolean canProgramOnlineAccessCodes); + + _FinalStage canSimulateRemoval(Optional canSimulateRemoval); + + _FinalStage canSimulateRemoval(Boolean canSimulateRemoval); + + _FinalStage canSimulateConnection(Optional canSimulateConnection); + + _FinalStage canSimulateConnection(Boolean canSimulateConnection); + + _FinalStage canSimulateDisconnection(Optional canSimulateDisconnection); + + _FinalStage canSimulateDisconnection(Boolean canSimulateDisconnection); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceIdStage, DeviceTypeStage, + DisplayNameStage, PropertiesStage, ConnectedAccountIdStage, WorkspaceIdStage, @@ -249,6 +442,8 @@ public static final class Builder private DeviceType deviceType; + private String displayName; + private DeviceProperties properties; private String connectedAccountId; @@ -259,23 +454,43 @@ public static final class Builder private boolean isManaged; + private Optional canSimulateDisconnection = Optional.empty(); + + private Optional canSimulateConnection = Optional.empty(); + + private Optional canSimulateRemoval = Optional.empty(); + + private Optional canProgramOnlineAccessCodes = Optional.empty(); + + private Optional canProgramOfflineAccessCodes = Optional.empty(); + + private Optional canRemotelyLock = Optional.empty(); + + private Optional canRemotelyUnlock = Optional.empty(); + + private Map customMetadata = new LinkedHashMap<>(); + private List warnings = new ArrayList<>(); private List errors = new ArrayList<>(); - private Optional location = Optional.empty(); + private Optional location = Optional.empty(); private List capabilitiesSupported = new ArrayList<>(); + private Optional nickname = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(Device other) { deviceId(other.getDeviceId()); deviceType(other.getDeviceType()); + nickname(other.getNickname()); + displayName(other.getDisplayName()); capabilitiesSupported(other.getCapabilitiesSupported()); properties(other.getProperties()); location(other.getLocation()); @@ -285,71 +500,237 @@ public Builder from(Device other) { warnings(other.getWarnings()); createdAt(other.getCreatedAt()); isManaged(other.getIsManaged()); + customMetadata(other.getCustomMetadata()); + canRemotelyUnlock(other.getCanRemotelyUnlock()); + canRemotelyLock(other.getCanRemotelyLock()); + canProgramOfflineAccessCodes(other.getCanProgramOfflineAccessCodes()); + canProgramOnlineAccessCodes(other.getCanProgramOnlineAccessCodes()); + canSimulateRemoval(other.getCanSimulateRemoval()); + canSimulateConnection(other.getCanSimulateConnection()); + canSimulateDisconnection(other.getCanSimulateDisconnection()); return this; } - @Override + /** + *

Unique identifier for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("device_id") public DeviceTypeStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + /** + *

Type of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("device_type") - public PropertiesStage deviceType(DeviceType deviceType) { + public DisplayNameStage deviceType(DeviceType deviceType) { this.deviceType = deviceType; return this; } - @Override + /** + *

Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("display_name") + public PropertiesStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + *

Properties of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("properties") public ConnectedAccountIdStage properties(DeviceProperties properties) { this.properties = properties; return this; } - @Override + /** + *

Unique identifier for the account associated with the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("connected_account_id") public WorkspaceIdStage connectedAccountId(String connectedAccountId) { this.connectedAccountId = connectedAccountId; return this; } - @Override + /** + *

Unique identifier for the Seam workspace associated with the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("workspace_id") public CreatedAtStage workspaceId(String workspaceId) { this.workspaceId = workspaceId; return this; } - @Override + /** + *

Date and time at which the device object was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("created_at") public IsManagedStage createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Override + /** + *

Indicates whether Seam manages the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("is_managed") public _FinalStage isManaged(boolean isManaged) { this.isManaged = isManaged; return this; } - @Override + @java.lang.Override + public _FinalStage canSimulateDisconnection(Boolean canSimulateDisconnection) { + this.canSimulateDisconnection = Optional.of(canSimulateDisconnection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_disconnection", nulls = Nulls.SKIP) + public _FinalStage canSimulateDisconnection(Optional canSimulateDisconnection) { + this.canSimulateDisconnection = canSimulateDisconnection; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateConnection(Boolean canSimulateConnection) { + this.canSimulateConnection = Optional.of(canSimulateConnection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_connection", nulls = Nulls.SKIP) + public _FinalStage canSimulateConnection(Optional canSimulateConnection) { + this.canSimulateConnection = canSimulateConnection; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateRemoval(Boolean canSimulateRemoval) { + this.canSimulateRemoval = Optional.of(canSimulateRemoval); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_removal", nulls = Nulls.SKIP) + public _FinalStage canSimulateRemoval(Optional canSimulateRemoval) { + this.canSimulateRemoval = canSimulateRemoval; + return this; + } + + @java.lang.Override + public _FinalStage canProgramOnlineAccessCodes(Boolean canProgramOnlineAccessCodes) { + this.canProgramOnlineAccessCodes = Optional.of(canProgramOnlineAccessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_program_online_access_codes", nulls = Nulls.SKIP) + public _FinalStage canProgramOnlineAccessCodes(Optional canProgramOnlineAccessCodes) { + this.canProgramOnlineAccessCodes = canProgramOnlineAccessCodes; + return this; + } + + @java.lang.Override + public _FinalStage canProgramOfflineAccessCodes(Boolean canProgramOfflineAccessCodes) { + this.canProgramOfflineAccessCodes = Optional.of(canProgramOfflineAccessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_program_offline_access_codes", nulls = Nulls.SKIP) + public _FinalStage canProgramOfflineAccessCodes(Optional canProgramOfflineAccessCodes) { + this.canProgramOfflineAccessCodes = canProgramOfflineAccessCodes; + return this; + } + + @java.lang.Override + public _FinalStage canRemotelyLock(Boolean canRemotelyLock) { + this.canRemotelyLock = Optional.of(canRemotelyLock); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_remotely_lock", nulls = Nulls.SKIP) + public _FinalStage canRemotelyLock(Optional canRemotelyLock) { + this.canRemotelyLock = canRemotelyLock; + return this; + } + + @java.lang.Override + public _FinalStage canRemotelyUnlock(Boolean canRemotelyUnlock) { + this.canRemotelyUnlock = Optional.of(canRemotelyUnlock); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_remotely_unlock", nulls = Nulls.SKIP) + public _FinalStage canRemotelyUnlock(Optional canRemotelyUnlock) { + this.canRemotelyUnlock = canRemotelyUnlock; + return this; + } + + @java.lang.Override + public _FinalStage customMetadata(String key, DeviceCustomMetadataValue value) { + this.customMetadata.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllCustomMetadata(Map customMetadata) { + this.customMetadata.putAll(customMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) + public _FinalStage customMetadata(Map customMetadata) { + this.customMetadata.clear(); + this.customMetadata.putAll(customMetadata); + return this; + } + + /** + *

Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addAllWarnings(List warnings) { this.warnings.addAll(warnings); return this; } - @Override + /** + *

Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addWarnings(DeviceWarningsItem warnings) { this.warnings.add(warnings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "warnings", nulls = Nulls.SKIP) public _FinalStage warnings(List warnings) { this.warnings.clear(); @@ -357,19 +738,27 @@ public _FinalStage warnings(List warnings) { return this; } - @Override + /** + *

Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addAllErrors(List errors) { this.errors.addAll(errors); return this; } - @Override + /** + *

Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addErrors(DeviceErrorsItem errors) { this.errors.add(errors); return this; } - @Override + @java.lang.Override @JsonSetter(value = "errors", nulls = Nulls.SKIP) public _FinalStage errors(List errors) { this.errors.clear(); @@ -377,32 +766,44 @@ public _FinalStage errors(List errors) { return this; } - @Override - public _FinalStage location(Object location) { + /** + *

Location information for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage location(DeviceLocation location) { this.location = Optional.of(location); return this; } - @Override + @java.lang.Override @JsonSetter(value = "location", nulls = Nulls.SKIP) - public _FinalStage location(Optional location) { + public _FinalStage location(Optional location) { this.location = location; return this; } - @Override + /** + *

Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addAllCapabilitiesSupported(List capabilitiesSupported) { this.capabilitiesSupported.addAll(capabilitiesSupported); return this; } - @Override + /** + *

Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addCapabilitiesSupported(DeviceCapabilitiesSupportedItem capabilitiesSupported) { this.capabilitiesSupported.add(capabilitiesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "capabilities_supported", nulls = Nulls.SKIP) public _FinalStage capabilitiesSupported(List capabilitiesSupported) { this.capabilitiesSupported.clear(); @@ -410,11 +811,30 @@ public _FinalStage capabilitiesSupported(List c return this; } - @Override + /** + *

Optional nickname to describe the device, settable through Seam

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage nickname(String nickname) { + this.nickname = Optional.of(nickname); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public _FinalStage nickname(Optional nickname) { + this.nickname = nickname; + return this; + } + + @java.lang.Override public Device build() { return new Device( deviceId, deviceType, + nickname, + displayName, capabilitiesSupported, properties, location, @@ -424,6 +844,14 @@ public Device build() { warnings, createdAt, isManaged, + customMetadata, + canRemotelyUnlock, + canRemotelyLock, + canProgramOfflineAccessCodes, + canProgramOnlineAccessCodes, + canSimulateRemoval, + canSimulateConnection, + canSimulateDisconnection, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/DeviceCapabilitiesSupportedItem.java b/src/main/java/com/seam/api/types/DeviceCapabilitiesSupportedItem.java index 65d4186..14a3d02 100644 --- a/src/main/java/com/seam/api/types/DeviceCapabilitiesSupportedItem.java +++ b/src/main/java/com/seam/api/types/DeviceCapabilitiesSupportedItem.java @@ -14,7 +14,9 @@ public enum DeviceCapabilitiesSupportedItem { THERMOSTAT("thermostat"), - BATTERY("battery"); + BATTERY("battery"), + + PHONE("phone"); private final String value; @@ -23,7 +25,7 @@ public enum DeviceCapabilitiesSupportedItem { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/DeviceCustomMetadataValue.java b/src/main/java/com/seam/api/types/DeviceCustomMetadataValue.java new file mode 100644 index 0000000..d917a44 --- /dev/null +++ b/src/main/java/com/seam/api/types/DeviceCustomMetadataValue.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DeviceCustomMetadataValue.Deserializer.class) +public final class DeviceCustomMetadataValue { + private final Object value; + + private final int type; + + private DeviceCustomMetadataValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeviceCustomMetadataValue && equalTo((DeviceCustomMetadataValue) other); + } + + private boolean equalTo(DeviceCustomMetadataValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DeviceCustomMetadataValue of(String value) { + return new DeviceCustomMetadataValue(value, 0); + } + + public static DeviceCustomMetadataValue of(boolean value) { + return new DeviceCustomMetadataValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DeviceCustomMetadataValue.class); + } + + @java.lang.Override + public DeviceCustomMetadataValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/types/DeviceErrorsItem.java b/src/main/java/com/seam/api/types/DeviceErrorsItem.java index 656d009..41d4ced 100644 --- a/src/main/java/com/seam/api/types/DeviceErrorsItem.java +++ b/src/main/java/com/seam/api/types/DeviceErrorsItem.java @@ -40,7 +40,7 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeviceErrorsItem && equalTo((DeviceErrorsItem) other); @@ -55,12 +55,12 @@ private boolean equalTo(DeviceErrorsItem other) { return errorCode.equals(other.errorCode) && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.errorCode, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +94,28 @@ public static final class Builder implements ErrorCodeStage, MessageStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(DeviceErrorsItem other) { errorCode(other.getErrorCode()); message(other.getMessage()); return this; } - @Override + @java.lang.Override @JsonSetter("error_code") public MessageStage errorCode(String errorCode) { this.errorCode = errorCode; return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(String message) { this.message = message; return this; } - @Override + @java.lang.Override public DeviceErrorsItem build() { return new DeviceErrorsItem(errorCode, message, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/DeviceListProvider.java b/src/main/java/com/seam/api/types/DeviceListProvider.java deleted file mode 100644 index 5b79f17..0000000 --- a/src/main/java/com/seam/api/types/DeviceListProvider.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = DeviceListProvider.Builder.class) -public final class DeviceListProvider { - private final String deviceProviderName; - - private final String displayName; - - private final String imageUrl; - - private final List providerCategories; - - private DeviceListProvider( - String deviceProviderName, - String displayName, - String imageUrl, - List providerCategories) { - this.deviceProviderName = deviceProviderName; - this.displayName = displayName; - this.imageUrl = imageUrl; - this.providerCategories = providerCategories; - } - - @JsonProperty("device_provider_name") - public String getDeviceProviderName() { - return deviceProviderName; - } - - @JsonProperty("display_name") - public String getDisplayName() { - return displayName; - } - - @JsonProperty("image_url") - public String getImageUrl() { - return imageUrl; - } - - @JsonProperty("provider_categories") - public List getProviderCategories() { - return providerCategories; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeviceListProvider && equalTo((DeviceListProvider) other); - } - - private boolean equalTo(DeviceListProvider other) { - return deviceProviderName.equals(other.deviceProviderName) - && displayName.equals(other.displayName) - && imageUrl.equals(other.imageUrl) - && providerCategories.equals(other.providerCategories); - } - - @Override - public int hashCode() { - return Objects.hash(this.deviceProviderName, this.displayName, this.imageUrl, this.providerCategories); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static DeviceProviderNameStage builder() { - return new Builder(); - } - - public interface DeviceProviderNameStage { - DisplayNameStage deviceProviderName(String deviceProviderName); - - Builder from(DeviceListProvider other); - } - - public interface DisplayNameStage { - ImageUrlStage displayName(String displayName); - } - - public interface ImageUrlStage { - _FinalStage imageUrl(String imageUrl); - } - - public interface _FinalStage { - DeviceListProvider build(); - - _FinalStage providerCategories( - List providerCategories); - - _FinalStage addProviderCategories( - DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem providerCategories); - - _FinalStage addAllProviderCategories( - List providerCategories); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DeviceProviderNameStage, DisplayNameStage, ImageUrlStage, _FinalStage { - private String deviceProviderName; - - private String displayName; - - private String imageUrl; - - private List providerCategories = - new ArrayList<>(); - - private Builder() {} - - @Override - public Builder from(DeviceListProvider other) { - deviceProviderName(other.getDeviceProviderName()); - displayName(other.getDisplayName()); - imageUrl(other.getImageUrl()); - providerCategories(other.getProviderCategories()); - return this; - } - - @Override - @JsonSetter("device_provider_name") - public DisplayNameStage deviceProviderName(String deviceProviderName) { - this.deviceProviderName = deviceProviderName; - return this; - } - - @Override - @JsonSetter("display_name") - public ImageUrlStage displayName(String displayName) { - this.displayName = displayName; - return this; - } - - @Override - @JsonSetter("image_url") - public _FinalStage imageUrl(String imageUrl) { - this.imageUrl = imageUrl; - return this; - } - - @Override - public _FinalStage addAllProviderCategories( - List providerCategories) { - this.providerCategories.addAll(providerCategories); - return this; - } - - @Override - public _FinalStage addProviderCategories( - DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem providerCategories) { - this.providerCategories.add(providerCategories); - return this; - } - - @Override - @JsonSetter(value = "provider_categories", nulls = Nulls.SKIP) - public _FinalStage providerCategories( - List providerCategories) { - this.providerCategories.clear(); - this.providerCategories.addAll(providerCategories); - return this; - } - - @Override - public DeviceListProvider build() { - return new DeviceListProvider(deviceProviderName, displayName, imageUrl, providerCategories); - } - } -} diff --git a/src/main/java/com/seam/api/types/DeviceLocation.java b/src/main/java/com/seam/api/types/DeviceLocation.java new file mode 100644 index 0000000..ff885c1 --- /dev/null +++ b/src/main/java/com/seam/api/types/DeviceLocation.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DeviceLocation.Builder.class) +public final class DeviceLocation { + private final Optional locationName; + + private final Optional timezone; + + private final Map additionalProperties; + + private DeviceLocation( + Optional locationName, Optional timezone, Map additionalProperties) { + this.locationName = locationName; + this.timezone = timezone; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the device location. + */ + @JsonProperty("location_name") + public Optional getLocationName() { + return locationName; + } + + /** + * @return Time zone of the device location. + */ + @JsonProperty("timezone") + public Optional getTimezone() { + return timezone; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeviceLocation && equalTo((DeviceLocation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeviceLocation other) { + return locationName.equals(other.locationName) && timezone.equals(other.timezone); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.locationName, this.timezone); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional locationName = Optional.empty(); + + private Optional timezone = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeviceLocation other) { + locationName(other.getLocationName()); + timezone(other.getTimezone()); + return this; + } + + @JsonSetter(value = "location_name", nulls = Nulls.SKIP) + public Builder locationName(Optional locationName) { + this.locationName = locationName; + return this; + } + + public Builder locationName(String locationName) { + this.locationName = Optional.of(locationName); + return this; + } + + @JsonSetter(value = "timezone", nulls = Nulls.SKIP) + public Builder timezone(Optional timezone) { + this.timezone = timezone; + return this; + } + + public Builder timezone(String timezone) { + this.timezone = Optional.of(timezone); + return this; + } + + public DeviceLocation build() { + return new DeviceLocation(locationName, timezone, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DeviceProperties.java b/src/main/java/com/seam/api/types/DeviceProperties.java index a089ff2..c80c997 100644 --- a/src/main/java/com/seam/api/types/DeviceProperties.java +++ b/src/main/java/com/seam/api/types/DeviceProperties.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -24,73 +25,538 @@ public final class DeviceProperties { private final String name; + private final Optional accessoryKeypad; + + private final DevicePropertiesAppearance appearance; + private final DevicePropertiesModel model; - private final Optional augustMetadata; + private final Optional hasDirectPower; + + private final Optional batteryLevel; + + private final Optional battery; + + private final Optional manufacturer; + + private final Optional imageUrl; + + private final Optional imageAltText; + + private final Optional serialNumber; + + private final Optional onlineAccessCodesEnabled; + + private final Optional offlineAccessCodesEnabled; + + private final Optional supportsAccessoryKeypad; + + private final Optional supportsOfflineAccessCodes; + + private final Optional noiseLevelDecibels; + + private final Optional> currentlyTriggeringNoiseThresholdIds; + + private final Optional assaAbloyCredentialServiceMetadata; + + private final Optional augustMetadata; + + private final Optional avigilonAltaMetadata; + + private final Optional schlageMetadata; + + private final Optional smartthingsMetadata; + + private final Optional locklyMetadata; + + private final Optional nukiMetadata; + + private final Optional kwiksetMetadata; + + private final Optional saltoMetadata; + + private final Optional genieMetadata; + + private final Optional brivoMetadata; + + private final Optional iglooMetadata; + + private final Optional noiseawareMetadata; + + private final Optional minutMetadata; + + private final Optional fourSuitesMetadata; + + private final Optional twoNMetadata; + + private final Optional controlbywebMetadata; + + private final Optional ttlockMetadata; - private final Optional schlageMetadata; + private final Optional seamBridgeMetadata; - private final Object smartthingsMetadata; + private final Optional igloohomeMetadata; - private final Optional currentClimateSetting; + private final Optional nestMetadata; + + private final Optional ecobeeMetadata; + + private final Optional honeywellResideoMetadata; + + private final Optional hubitatMetadata; + + private final Optional dormakabaOracodeMetadata; + + private final Optional wyzeMetadata; + + private final Optional tedeeMetadata; + + private final Optional> experimentalSupportedCodeFromAccessCodesLengths; + + private final Optional> codeConstraints; + + private final Optional> supportedCodeLengths; + + private final Optional maxActiveCodesSupported; + + private final Optional supportsBackupAccessCodePool; + + private final Optional hasNativeEntryEvents; + + private final Optional locked; + + private final Optional keypadBattery; + + private final Optional doorOpen; private final Map additionalProperties; private DeviceProperties( boolean online, String name, + Optional accessoryKeypad, + DevicePropertiesAppearance appearance, DevicePropertiesModel model, - Optional augustMetadata, - Optional schlageMetadata, - Object smartthingsMetadata, - Optional currentClimateSetting, + Optional hasDirectPower, + Optional batteryLevel, + Optional battery, + Optional manufacturer, + Optional imageUrl, + Optional imageAltText, + Optional serialNumber, + Optional onlineAccessCodesEnabled, + Optional offlineAccessCodesEnabled, + Optional supportsAccessoryKeypad, + Optional supportsOfflineAccessCodes, + Optional noiseLevelDecibels, + Optional> currentlyTriggeringNoiseThresholdIds, + Optional assaAbloyCredentialServiceMetadata, + Optional augustMetadata, + Optional avigilonAltaMetadata, + Optional schlageMetadata, + Optional smartthingsMetadata, + Optional locklyMetadata, + Optional nukiMetadata, + Optional kwiksetMetadata, + Optional saltoMetadata, + Optional genieMetadata, + Optional brivoMetadata, + Optional iglooMetadata, + Optional noiseawareMetadata, + Optional minutMetadata, + Optional fourSuitesMetadata, + Optional twoNMetadata, + Optional controlbywebMetadata, + Optional ttlockMetadata, + Optional seamBridgeMetadata, + Optional igloohomeMetadata, + Optional nestMetadata, + Optional ecobeeMetadata, + Optional honeywellResideoMetadata, + Optional hubitatMetadata, + Optional dormakabaOracodeMetadata, + Optional wyzeMetadata, + Optional tedeeMetadata, + Optional> experimentalSupportedCodeFromAccessCodesLengths, + Optional> codeConstraints, + Optional> supportedCodeLengths, + Optional maxActiveCodesSupported, + Optional supportsBackupAccessCodePool, + Optional hasNativeEntryEvents, + Optional locked, + Optional keypadBattery, + Optional doorOpen, Map additionalProperties) { this.online = online; this.name = name; + this.accessoryKeypad = accessoryKeypad; + this.appearance = appearance; this.model = model; + this.hasDirectPower = hasDirectPower; + this.batteryLevel = batteryLevel; + this.battery = battery; + this.manufacturer = manufacturer; + this.imageUrl = imageUrl; + this.imageAltText = imageAltText; + this.serialNumber = serialNumber; + this.onlineAccessCodesEnabled = onlineAccessCodesEnabled; + this.offlineAccessCodesEnabled = offlineAccessCodesEnabled; + this.supportsAccessoryKeypad = supportsAccessoryKeypad; + this.supportsOfflineAccessCodes = supportsOfflineAccessCodes; + this.noiseLevelDecibels = noiseLevelDecibels; + this.currentlyTriggeringNoiseThresholdIds = currentlyTriggeringNoiseThresholdIds; + this.assaAbloyCredentialServiceMetadata = assaAbloyCredentialServiceMetadata; this.augustMetadata = augustMetadata; + this.avigilonAltaMetadata = avigilonAltaMetadata; this.schlageMetadata = schlageMetadata; this.smartthingsMetadata = smartthingsMetadata; - this.currentClimateSetting = currentClimateSetting; + this.locklyMetadata = locklyMetadata; + this.nukiMetadata = nukiMetadata; + this.kwiksetMetadata = kwiksetMetadata; + this.saltoMetadata = saltoMetadata; + this.genieMetadata = genieMetadata; + this.brivoMetadata = brivoMetadata; + this.iglooMetadata = iglooMetadata; + this.noiseawareMetadata = noiseawareMetadata; + this.minutMetadata = minutMetadata; + this.fourSuitesMetadata = fourSuitesMetadata; + this.twoNMetadata = twoNMetadata; + this.controlbywebMetadata = controlbywebMetadata; + this.ttlockMetadata = ttlockMetadata; + this.seamBridgeMetadata = seamBridgeMetadata; + this.igloohomeMetadata = igloohomeMetadata; + this.nestMetadata = nestMetadata; + this.ecobeeMetadata = ecobeeMetadata; + this.honeywellResideoMetadata = honeywellResideoMetadata; + this.hubitatMetadata = hubitatMetadata; + this.dormakabaOracodeMetadata = dormakabaOracodeMetadata; + this.wyzeMetadata = wyzeMetadata; + this.tedeeMetadata = tedeeMetadata; + this.experimentalSupportedCodeFromAccessCodesLengths = experimentalSupportedCodeFromAccessCodesLengths; + this.codeConstraints = codeConstraints; + this.supportedCodeLengths = supportedCodeLengths; + this.maxActiveCodesSupported = maxActiveCodesSupported; + this.supportsBackupAccessCodePool = supportsBackupAccessCodePool; + this.hasNativeEntryEvents = hasNativeEntryEvents; + this.locked = locked; + this.keypadBattery = keypadBattery; + this.doorOpen = doorOpen; this.additionalProperties = additionalProperties; } + /** + * @return Indicates whether the device is online. + */ @JsonProperty("online") public boolean getOnline() { return online; } + /** + * @return Name of the device. + */ @JsonProperty("name") public String getName() { return name; } + /** + * @return Represents the accessory keypad state. + */ + @JsonProperty("accessory_keypad") + public Optional getAccessoryKeypad() { + return accessoryKeypad; + } + + @JsonProperty("appearance") + public DevicePropertiesAppearance getAppearance() { + return appearance; + } + @JsonProperty("model") public DevicePropertiesModel getModel() { return model; } + /** + * @return Indicates whether the device has direct power. + */ + @JsonProperty("has_direct_power") + public Optional getHasDirectPower() { + return hasDirectPower; + } + + /** + * @return Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. + */ + @JsonProperty("battery_level") + public Optional getBatteryLevel() { + return batteryLevel; + } + + /** + * @return Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage. + */ + @JsonProperty("battery") + public Optional getBattery() { + return battery; + } + + /** + * @return Manufacturer of the device. + */ + @JsonProperty("manufacturer") + public Optional getManufacturer() { + return manufacturer; + } + + /** + * @return Image URL for the device. + */ + @JsonProperty("image_url") + public Optional getImageUrl() { + return imageUrl; + } + + /** + * @return Alt text for the device image. + */ + @JsonProperty("image_alt_text") + public Optional getImageAltText() { + return imageAltText; + } + + /** + * @return Serial number of the device. + */ + @JsonProperty("serial_number") + public Optional getSerialNumber() { + return serialNumber; + } + + /** + * @return Indicates whether it is currently possible to use online access codes for the device. + */ + @JsonProperty("online_access_codes_enabled") + public Optional getOnlineAccessCodesEnabled() { + return onlineAccessCodesEnabled; + } + + /** + * @return Indicates whether it is currently possible to use offline access codes for the device. + */ + @JsonProperty("offline_access_codes_enabled") + public Optional getOfflineAccessCodesEnabled() { + return offlineAccessCodesEnabled; + } + + @JsonProperty("supports_accessory_keypad") + public Optional getSupportsAccessoryKeypad() { + return supportsAccessoryKeypad; + } + + @JsonProperty("supports_offline_access_codes") + public Optional getSupportsOfflineAccessCodes() { + return supportsOfflineAccessCodes; + } + + /** + * @return Indicates current noise level in decibels, if the device supports noise detection. + */ + @JsonProperty("noise_level_decibels") + public Optional getNoiseLevelDecibels() { + return noiseLevelDecibels; + } + + /** + * @return Array of noise threshold IDs that are currently triggering. + */ + @JsonProperty("currently_triggering_noise_threshold_ids") + public Optional> getCurrentlyTriggeringNoiseThresholdIds() { + return currentlyTriggeringNoiseThresholdIds; + } + + @JsonProperty("assa_abloy_credential_service_metadata") + public Optional getAssaAbloyCredentialServiceMetadata() { + return assaAbloyCredentialServiceMetadata; + } + @JsonProperty("august_metadata") - public Optional getAugustMetadata() { + public Optional getAugustMetadata() { return augustMetadata; } + @JsonProperty("avigilon_alta_metadata") + public Optional getAvigilonAltaMetadata() { + return avigilonAltaMetadata; + } + @JsonProperty("schlage_metadata") - public Optional getSchlageMetadata() { + public Optional getSchlageMetadata() { return schlageMetadata; } @JsonProperty("smartthings_metadata") - public Object getSmartthingsMetadata() { + public Optional getSmartthingsMetadata() { return smartthingsMetadata; } - @JsonProperty("current_climate_setting") - public Optional getCurrentClimateSetting() { - return currentClimateSetting; + @JsonProperty("lockly_metadata") + public Optional getLocklyMetadata() { + return locklyMetadata; + } + + @JsonProperty("nuki_metadata") + public Optional getNukiMetadata() { + return nukiMetadata; + } + + @JsonProperty("kwikset_metadata") + public Optional getKwiksetMetadata() { + return kwiksetMetadata; + } + + @JsonProperty("salto_metadata") + public Optional getSaltoMetadata() { + return saltoMetadata; + } + + @JsonProperty("genie_metadata") + public Optional getGenieMetadata() { + return genieMetadata; + } + + @JsonProperty("brivo_metadata") + public Optional getBrivoMetadata() { + return brivoMetadata; + } + + @JsonProperty("igloo_metadata") + public Optional getIglooMetadata() { + return iglooMetadata; + } + + @JsonProperty("noiseaware_metadata") + public Optional getNoiseawareMetadata() { + return noiseawareMetadata; + } + + @JsonProperty("minut_metadata") + public Optional getMinutMetadata() { + return minutMetadata; + } + + @JsonProperty("four_suites_metadata") + public Optional getFourSuitesMetadata() { + return fourSuitesMetadata; + } + + @JsonProperty("two_n_metadata") + public Optional getTwoNMetadata() { + return twoNMetadata; + } + + @JsonProperty("controlbyweb_metadata") + public Optional getControlbywebMetadata() { + return controlbywebMetadata; + } + + @JsonProperty("ttlock_metadata") + public Optional getTtlockMetadata() { + return ttlockMetadata; + } + + @JsonProperty("seam_bridge_metadata") + public Optional getSeamBridgeMetadata() { + return seamBridgeMetadata; + } + + @JsonProperty("igloohome_metadata") + public Optional getIgloohomeMetadata() { + return igloohomeMetadata; + } + + @JsonProperty("nest_metadata") + public Optional getNestMetadata() { + return nestMetadata; + } + + @JsonProperty("ecobee_metadata") + public Optional getEcobeeMetadata() { + return ecobeeMetadata; + } + + @JsonProperty("honeywell_resideo_metadata") + public Optional getHoneywellResideoMetadata() { + return honeywellResideoMetadata; + } + + @JsonProperty("hubitat_metadata") + public Optional getHubitatMetadata() { + return hubitatMetadata; + } + + @JsonProperty("dormakaba_oracode_metadata") + public Optional getDormakabaOracodeMetadata() { + return dormakabaOracodeMetadata; + } + + @JsonProperty("wyze_metadata") + public Optional getWyzeMetadata() { + return wyzeMetadata; + } + + @JsonProperty("tedee_metadata") + public Optional getTedeeMetadata() { + return tedeeMetadata; + } + + @JsonProperty("_experimental_supported_code_from_access_codes_lengths") + public Optional> getExperimentalSupportedCodeFromAccessCodesLengths() { + return experimentalSupportedCodeFromAccessCodesLengths; + } + + @JsonProperty("code_constraints") + public Optional> getCodeConstraints() { + return codeConstraints; + } + + @JsonProperty("supported_code_lengths") + public Optional> getSupportedCodeLengths() { + return supportedCodeLengths; + } + + @JsonProperty("max_active_codes_supported") + public Optional getMaxActiveCodesSupported() { + return maxActiveCodesSupported; + } + + @JsonProperty("supports_backup_access_code_pool") + public Optional getSupportsBackupAccessCodePool() { + return supportsBackupAccessCodePool; + } + + @JsonProperty("has_native_entry_events") + public Optional getHasNativeEntryEvents() { + return hasNativeEntryEvents; + } + + @JsonProperty("locked") + public Optional getLocked() { + return locked; + } + + @JsonProperty("keypad_battery") + public Optional getKeypadBattery() { + return keypadBattery; + } + + @JsonProperty("door_open") + public Optional getDoorOpen() { + return doorOpen; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeviceProperties && equalTo((DeviceProperties) other); @@ -104,26 +570,121 @@ public Map getAdditionalProperties() { private boolean equalTo(DeviceProperties other) { return online == other.online && name.equals(other.name) + && accessoryKeypad.equals(other.accessoryKeypad) + && appearance.equals(other.appearance) && model.equals(other.model) + && hasDirectPower.equals(other.hasDirectPower) + && batteryLevel.equals(other.batteryLevel) + && battery.equals(other.battery) + && manufacturer.equals(other.manufacturer) + && imageUrl.equals(other.imageUrl) + && imageAltText.equals(other.imageAltText) + && serialNumber.equals(other.serialNumber) + && onlineAccessCodesEnabled.equals(other.onlineAccessCodesEnabled) + && offlineAccessCodesEnabled.equals(other.offlineAccessCodesEnabled) + && supportsAccessoryKeypad.equals(other.supportsAccessoryKeypad) + && supportsOfflineAccessCodes.equals(other.supportsOfflineAccessCodes) + && noiseLevelDecibels.equals(other.noiseLevelDecibels) + && currentlyTriggeringNoiseThresholdIds.equals(other.currentlyTriggeringNoiseThresholdIds) + && assaAbloyCredentialServiceMetadata.equals(other.assaAbloyCredentialServiceMetadata) && augustMetadata.equals(other.augustMetadata) + && avigilonAltaMetadata.equals(other.avigilonAltaMetadata) && schlageMetadata.equals(other.schlageMetadata) && smartthingsMetadata.equals(other.smartthingsMetadata) - && currentClimateSetting.equals(other.currentClimateSetting); + && locklyMetadata.equals(other.locklyMetadata) + && nukiMetadata.equals(other.nukiMetadata) + && kwiksetMetadata.equals(other.kwiksetMetadata) + && saltoMetadata.equals(other.saltoMetadata) + && genieMetadata.equals(other.genieMetadata) + && brivoMetadata.equals(other.brivoMetadata) + && iglooMetadata.equals(other.iglooMetadata) + && noiseawareMetadata.equals(other.noiseawareMetadata) + && minutMetadata.equals(other.minutMetadata) + && fourSuitesMetadata.equals(other.fourSuitesMetadata) + && twoNMetadata.equals(other.twoNMetadata) + && controlbywebMetadata.equals(other.controlbywebMetadata) + && ttlockMetadata.equals(other.ttlockMetadata) + && seamBridgeMetadata.equals(other.seamBridgeMetadata) + && igloohomeMetadata.equals(other.igloohomeMetadata) + && nestMetadata.equals(other.nestMetadata) + && ecobeeMetadata.equals(other.ecobeeMetadata) + && honeywellResideoMetadata.equals(other.honeywellResideoMetadata) + && hubitatMetadata.equals(other.hubitatMetadata) + && dormakabaOracodeMetadata.equals(other.dormakabaOracodeMetadata) + && wyzeMetadata.equals(other.wyzeMetadata) + && tedeeMetadata.equals(other.tedeeMetadata) + && experimentalSupportedCodeFromAccessCodesLengths.equals( + other.experimentalSupportedCodeFromAccessCodesLengths) + && codeConstraints.equals(other.codeConstraints) + && supportedCodeLengths.equals(other.supportedCodeLengths) + && maxActiveCodesSupported.equals(other.maxActiveCodesSupported) + && supportsBackupAccessCodePool.equals(other.supportsBackupAccessCodePool) + && hasNativeEntryEvents.equals(other.hasNativeEntryEvents) + && locked.equals(other.locked) + && keypadBattery.equals(other.keypadBattery) + && doorOpen.equals(other.doorOpen); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.online, this.name, + this.accessoryKeypad, + this.appearance, this.model, + this.hasDirectPower, + this.batteryLevel, + this.battery, + this.manufacturer, + this.imageUrl, + this.imageAltText, + this.serialNumber, + this.onlineAccessCodesEnabled, + this.offlineAccessCodesEnabled, + this.supportsAccessoryKeypad, + this.supportsOfflineAccessCodes, + this.noiseLevelDecibels, + this.currentlyTriggeringNoiseThresholdIds, + this.assaAbloyCredentialServiceMetadata, this.augustMetadata, + this.avigilonAltaMetadata, this.schlageMetadata, this.smartthingsMetadata, - this.currentClimateSetting); + this.locklyMetadata, + this.nukiMetadata, + this.kwiksetMetadata, + this.saltoMetadata, + this.genieMetadata, + this.brivoMetadata, + this.iglooMetadata, + this.noiseawareMetadata, + this.minutMetadata, + this.fourSuitesMetadata, + this.twoNMetadata, + this.controlbywebMetadata, + this.ttlockMetadata, + this.seamBridgeMetadata, + this.igloohomeMetadata, + this.nestMetadata, + this.ecobeeMetadata, + this.honeywellResideoMetadata, + this.hubitatMetadata, + this.dormakabaOracodeMetadata, + this.wyzeMetadata, + this.tedeeMetadata, + this.experimentalSupportedCodeFromAccessCodesLengths, + this.codeConstraints, + this.supportedCodeLengths, + this.maxActiveCodesSupported, + this.supportsBackupAccessCodePool, + this.hasNativeEntryEvents, + this.locked, + this.keypadBattery, + this.doorOpen); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -139,144 +700,1201 @@ public interface OnlineStage { } public interface NameStage { - ModelStage name(String name); + AppearanceStage name(String name); } - public interface ModelStage { - SmartthingsMetadataStage model(DevicePropertiesModel model); + public interface AppearanceStage { + ModelStage appearance(DevicePropertiesAppearance appearance); } - public interface SmartthingsMetadataStage { - _FinalStage smartthingsMetadata(Object smartthingsMetadata); + public interface ModelStage { + _FinalStage model(DevicePropertiesModel model); } public interface _FinalStage { DeviceProperties build(); - _FinalStage augustMetadata(Optional augustMetadata); + _FinalStage accessoryKeypad(Optional accessoryKeypad); - _FinalStage augustMetadata(AugustDeviceMetadata augustMetadata); + _FinalStage accessoryKeypad(DevicePropertiesAccessoryKeypad accessoryKeypad); - _FinalStage schlageMetadata(Optional schlageMetadata); + _FinalStage hasDirectPower(Optional hasDirectPower); - _FinalStage schlageMetadata(SchlageDeviceMetadata schlageMetadata); + _FinalStage hasDirectPower(Boolean hasDirectPower); - _FinalStage currentClimateSetting(Optional currentClimateSetting); + _FinalStage batteryLevel(Optional batteryLevel); - _FinalStage currentClimateSetting(CurrentClimateSetting currentClimateSetting); - } + _FinalStage batteryLevel(Double batteryLevel); - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements OnlineStage, NameStage, ModelStage, SmartthingsMetadataStage, _FinalStage { - private boolean online; + _FinalStage battery(Optional battery); - private String name; + _FinalStage battery(DevicePropertiesBattery battery); - private DevicePropertiesModel model; + _FinalStage manufacturer(Optional manufacturer); - private Object smartthingsMetadata; + _FinalStage manufacturer(String manufacturer); - private Optional currentClimateSetting = Optional.empty(); + _FinalStage imageUrl(Optional imageUrl); - private Optional schlageMetadata = Optional.empty(); + _FinalStage imageUrl(String imageUrl); - private Optional augustMetadata = Optional.empty(); + _FinalStage imageAltText(Optional imageAltText); - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); + _FinalStage imageAltText(String imageAltText); - private Builder() {} + _FinalStage serialNumber(Optional serialNumber); - @Override - public Builder from(DeviceProperties other) { - online(other.getOnline()); - name(other.getName()); - model(other.getModel()); - augustMetadata(other.getAugustMetadata()); - schlageMetadata(other.getSchlageMetadata()); - smartthingsMetadata(other.getSmartthingsMetadata()); - currentClimateSetting(other.getCurrentClimateSetting()); - return this; - } + _FinalStage serialNumber(String serialNumber); - @Override - @JsonSetter("online") - public NameStage online(boolean online) { - this.online = online; - return this; - } + _FinalStage onlineAccessCodesEnabled(Optional onlineAccessCodesEnabled); - @Override - @JsonSetter("name") - public ModelStage name(String name) { - this.name = name; - return this; - } + _FinalStage onlineAccessCodesEnabled(Boolean onlineAccessCodesEnabled); - @Override - @JsonSetter("model") - public SmartthingsMetadataStage model(DevicePropertiesModel model) { - this.model = model; - return this; - } + _FinalStage offlineAccessCodesEnabled(Optional offlineAccessCodesEnabled); - @Override - @JsonSetter("smartthings_metadata") - public _FinalStage smartthingsMetadata(Object smartthingsMetadata) { - this.smartthingsMetadata = smartthingsMetadata; - return this; - } + _FinalStage offlineAccessCodesEnabled(Boolean offlineAccessCodesEnabled); - @Override - public _FinalStage currentClimateSetting(CurrentClimateSetting currentClimateSetting) { - this.currentClimateSetting = Optional.of(currentClimateSetting); - return this; - } + _FinalStage supportsAccessoryKeypad(Optional supportsAccessoryKeypad); - @Override - @JsonSetter(value = "current_climate_setting", nulls = Nulls.SKIP) - public _FinalStage currentClimateSetting(Optional currentClimateSetting) { - this.currentClimateSetting = currentClimateSetting; - return this; - } + _FinalStage supportsAccessoryKeypad(Boolean supportsAccessoryKeypad); - @Override - public _FinalStage schlageMetadata(SchlageDeviceMetadata schlageMetadata) { - this.schlageMetadata = Optional.of(schlageMetadata); - return this; - } + _FinalStage supportsOfflineAccessCodes(Optional supportsOfflineAccessCodes); - @Override - @JsonSetter(value = "schlage_metadata", nulls = Nulls.SKIP) - public _FinalStage schlageMetadata(Optional schlageMetadata) { - this.schlageMetadata = schlageMetadata; - return this; - } + _FinalStage supportsOfflineAccessCodes(Boolean supportsOfflineAccessCodes); - @Override - public _FinalStage augustMetadata(AugustDeviceMetadata augustMetadata) { - this.augustMetadata = Optional.of(augustMetadata); - return this; - } + _FinalStage noiseLevelDecibels(Optional noiseLevelDecibels); - @Override - @JsonSetter(value = "august_metadata", nulls = Nulls.SKIP) - public _FinalStage augustMetadata(Optional augustMetadata) { - this.augustMetadata = augustMetadata; + _FinalStage noiseLevelDecibels(Double noiseLevelDecibels); + + _FinalStage currentlyTriggeringNoiseThresholdIds(Optional> currentlyTriggeringNoiseThresholdIds); + + _FinalStage currentlyTriggeringNoiseThresholdIds(List currentlyTriggeringNoiseThresholdIds); + + _FinalStage assaAbloyCredentialServiceMetadata( + Optional assaAbloyCredentialServiceMetadata); + + _FinalStage assaAbloyCredentialServiceMetadata( + DevicePropertiesAssaAbloyCredentialServiceMetadata assaAbloyCredentialServiceMetadata); + + _FinalStage augustMetadata(Optional augustMetadata); + + _FinalStage augustMetadata(DevicePropertiesAugustMetadata augustMetadata); + + _FinalStage avigilonAltaMetadata(Optional avigilonAltaMetadata); + + _FinalStage avigilonAltaMetadata(DevicePropertiesAvigilonAltaMetadata avigilonAltaMetadata); + + _FinalStage schlageMetadata(Optional schlageMetadata); + + _FinalStage schlageMetadata(DevicePropertiesSchlageMetadata schlageMetadata); + + _FinalStage smartthingsMetadata(Optional smartthingsMetadata); + + _FinalStage smartthingsMetadata(DevicePropertiesSmartthingsMetadata smartthingsMetadata); + + _FinalStage locklyMetadata(Optional locklyMetadata); + + _FinalStage locklyMetadata(DevicePropertiesLocklyMetadata locklyMetadata); + + _FinalStage nukiMetadata(Optional nukiMetadata); + + _FinalStage nukiMetadata(DevicePropertiesNukiMetadata nukiMetadata); + + _FinalStage kwiksetMetadata(Optional kwiksetMetadata); + + _FinalStage kwiksetMetadata(DevicePropertiesKwiksetMetadata kwiksetMetadata); + + _FinalStage saltoMetadata(Optional saltoMetadata); + + _FinalStage saltoMetadata(DevicePropertiesSaltoMetadata saltoMetadata); + + _FinalStage genieMetadata(Optional genieMetadata); + + _FinalStage genieMetadata(DevicePropertiesGenieMetadata genieMetadata); + + _FinalStage brivoMetadata(Optional brivoMetadata); + + _FinalStage brivoMetadata(DevicePropertiesBrivoMetadata brivoMetadata); + + _FinalStage iglooMetadata(Optional iglooMetadata); + + _FinalStage iglooMetadata(DevicePropertiesIglooMetadata iglooMetadata); + + _FinalStage noiseawareMetadata(Optional noiseawareMetadata); + + _FinalStage noiseawareMetadata(DevicePropertiesNoiseawareMetadata noiseawareMetadata); + + _FinalStage minutMetadata(Optional minutMetadata); + + _FinalStage minutMetadata(DevicePropertiesMinutMetadata minutMetadata); + + _FinalStage fourSuitesMetadata(Optional fourSuitesMetadata); + + _FinalStage fourSuitesMetadata(DevicePropertiesFourSuitesMetadata fourSuitesMetadata); + + _FinalStage twoNMetadata(Optional twoNMetadata); + + _FinalStage twoNMetadata(DevicePropertiesTwoNMetadata twoNMetadata); + + _FinalStage controlbywebMetadata(Optional controlbywebMetadata); + + _FinalStage controlbywebMetadata(DevicePropertiesControlbywebMetadata controlbywebMetadata); + + _FinalStage ttlockMetadata(Optional ttlockMetadata); + + _FinalStage ttlockMetadata(DevicePropertiesTtlockMetadata ttlockMetadata); + + _FinalStage seamBridgeMetadata(Optional seamBridgeMetadata); + + _FinalStage seamBridgeMetadata(DevicePropertiesSeamBridgeMetadata seamBridgeMetadata); + + _FinalStage igloohomeMetadata(Optional igloohomeMetadata); + + _FinalStage igloohomeMetadata(DevicePropertiesIgloohomeMetadata igloohomeMetadata); + + _FinalStage nestMetadata(Optional nestMetadata); + + _FinalStage nestMetadata(DevicePropertiesNestMetadata nestMetadata); + + _FinalStage ecobeeMetadata(Optional ecobeeMetadata); + + _FinalStage ecobeeMetadata(DevicePropertiesEcobeeMetadata ecobeeMetadata); + + _FinalStage honeywellResideoMetadata( + Optional honeywellResideoMetadata); + + _FinalStage honeywellResideoMetadata(DevicePropertiesHoneywellResideoMetadata honeywellResideoMetadata); + + _FinalStage hubitatMetadata(Optional hubitatMetadata); + + _FinalStage hubitatMetadata(DevicePropertiesHubitatMetadata hubitatMetadata); + + _FinalStage dormakabaOracodeMetadata( + Optional dormakabaOracodeMetadata); + + _FinalStage dormakabaOracodeMetadata(DevicePropertiesDormakabaOracodeMetadata dormakabaOracodeMetadata); + + _FinalStage wyzeMetadata(Optional wyzeMetadata); + + _FinalStage wyzeMetadata(DevicePropertiesWyzeMetadata wyzeMetadata); + + _FinalStage tedeeMetadata(Optional tedeeMetadata); + + _FinalStage tedeeMetadata(DevicePropertiesTedeeMetadata tedeeMetadata); + + _FinalStage experimentalSupportedCodeFromAccessCodesLengths( + Optional> experimentalSupportedCodeFromAccessCodesLengths); + + _FinalStage experimentalSupportedCodeFromAccessCodesLengths( + List experimentalSupportedCodeFromAccessCodesLengths); + + _FinalStage codeConstraints(Optional> codeConstraints); + + _FinalStage codeConstraints(List codeConstraints); + + _FinalStage supportedCodeLengths(Optional> supportedCodeLengths); + + _FinalStage supportedCodeLengths(List supportedCodeLengths); + + _FinalStage maxActiveCodesSupported(Optional maxActiveCodesSupported); + + _FinalStage maxActiveCodesSupported(Double maxActiveCodesSupported); + + _FinalStage supportsBackupAccessCodePool(Optional supportsBackupAccessCodePool); + + _FinalStage supportsBackupAccessCodePool(Boolean supportsBackupAccessCodePool); + + _FinalStage hasNativeEntryEvents(Optional hasNativeEntryEvents); + + _FinalStage hasNativeEntryEvents(Boolean hasNativeEntryEvents); + + _FinalStage locked(Optional locked); + + _FinalStage locked(Boolean locked); + + _FinalStage keypadBattery(Optional keypadBattery); + + _FinalStage keypadBattery(DevicePropertiesKeypadBattery keypadBattery); + + _FinalStage doorOpen(Optional doorOpen); + + _FinalStage doorOpen(Boolean doorOpen); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OnlineStage, NameStage, AppearanceStage, ModelStage, _FinalStage { + private boolean online; + + private String name; + + private DevicePropertiesAppearance appearance; + + private DevicePropertiesModel model; + + private Optional doorOpen = Optional.empty(); + + private Optional keypadBattery = Optional.empty(); + + private Optional locked = Optional.empty(); + + private Optional hasNativeEntryEvents = Optional.empty(); + + private Optional supportsBackupAccessCodePool = Optional.empty(); + + private Optional maxActiveCodesSupported = Optional.empty(); + + private Optional> supportedCodeLengths = Optional.empty(); + + private Optional> codeConstraints = Optional.empty(); + + private Optional> experimentalSupportedCodeFromAccessCodesLengths = Optional.empty(); + + private Optional tedeeMetadata = Optional.empty(); + + private Optional wyzeMetadata = Optional.empty(); + + private Optional dormakabaOracodeMetadata = Optional.empty(); + + private Optional hubitatMetadata = Optional.empty(); + + private Optional honeywellResideoMetadata = Optional.empty(); + + private Optional ecobeeMetadata = Optional.empty(); + + private Optional nestMetadata = Optional.empty(); + + private Optional igloohomeMetadata = Optional.empty(); + + private Optional seamBridgeMetadata = Optional.empty(); + + private Optional ttlockMetadata = Optional.empty(); + + private Optional controlbywebMetadata = Optional.empty(); + + private Optional twoNMetadata = Optional.empty(); + + private Optional fourSuitesMetadata = Optional.empty(); + + private Optional minutMetadata = Optional.empty(); + + private Optional noiseawareMetadata = Optional.empty(); + + private Optional iglooMetadata = Optional.empty(); + + private Optional brivoMetadata = Optional.empty(); + + private Optional genieMetadata = Optional.empty(); + + private Optional saltoMetadata = Optional.empty(); + + private Optional kwiksetMetadata = Optional.empty(); + + private Optional nukiMetadata = Optional.empty(); + + private Optional locklyMetadata = Optional.empty(); + + private Optional smartthingsMetadata = Optional.empty(); + + private Optional schlageMetadata = Optional.empty(); + + private Optional avigilonAltaMetadata = Optional.empty(); + + private Optional augustMetadata = Optional.empty(); + + private Optional assaAbloyCredentialServiceMetadata = + Optional.empty(); + + private Optional> currentlyTriggeringNoiseThresholdIds = Optional.empty(); + + private Optional noiseLevelDecibels = Optional.empty(); + + private Optional supportsOfflineAccessCodes = Optional.empty(); + + private Optional supportsAccessoryKeypad = Optional.empty(); + + private Optional offlineAccessCodesEnabled = Optional.empty(); + + private Optional onlineAccessCodesEnabled = Optional.empty(); + + private Optional serialNumber = Optional.empty(); + + private Optional imageAltText = Optional.empty(); + + private Optional imageUrl = Optional.empty(); + + private Optional manufacturer = Optional.empty(); + + private Optional battery = Optional.empty(); + + private Optional batteryLevel = Optional.empty(); + + private Optional hasDirectPower = Optional.empty(); + + private Optional accessoryKeypad = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeviceProperties other) { + online(other.getOnline()); + name(other.getName()); + accessoryKeypad(other.getAccessoryKeypad()); + appearance(other.getAppearance()); + model(other.getModel()); + hasDirectPower(other.getHasDirectPower()); + batteryLevel(other.getBatteryLevel()); + battery(other.getBattery()); + manufacturer(other.getManufacturer()); + imageUrl(other.getImageUrl()); + imageAltText(other.getImageAltText()); + serialNumber(other.getSerialNumber()); + onlineAccessCodesEnabled(other.getOnlineAccessCodesEnabled()); + offlineAccessCodesEnabled(other.getOfflineAccessCodesEnabled()); + supportsAccessoryKeypad(other.getSupportsAccessoryKeypad()); + supportsOfflineAccessCodes(other.getSupportsOfflineAccessCodes()); + noiseLevelDecibels(other.getNoiseLevelDecibels()); + currentlyTriggeringNoiseThresholdIds(other.getCurrentlyTriggeringNoiseThresholdIds()); + assaAbloyCredentialServiceMetadata(other.getAssaAbloyCredentialServiceMetadata()); + augustMetadata(other.getAugustMetadata()); + avigilonAltaMetadata(other.getAvigilonAltaMetadata()); + schlageMetadata(other.getSchlageMetadata()); + smartthingsMetadata(other.getSmartthingsMetadata()); + locklyMetadata(other.getLocklyMetadata()); + nukiMetadata(other.getNukiMetadata()); + kwiksetMetadata(other.getKwiksetMetadata()); + saltoMetadata(other.getSaltoMetadata()); + genieMetadata(other.getGenieMetadata()); + brivoMetadata(other.getBrivoMetadata()); + iglooMetadata(other.getIglooMetadata()); + noiseawareMetadata(other.getNoiseawareMetadata()); + minutMetadata(other.getMinutMetadata()); + fourSuitesMetadata(other.getFourSuitesMetadata()); + twoNMetadata(other.getTwoNMetadata()); + controlbywebMetadata(other.getControlbywebMetadata()); + ttlockMetadata(other.getTtlockMetadata()); + seamBridgeMetadata(other.getSeamBridgeMetadata()); + igloohomeMetadata(other.getIgloohomeMetadata()); + nestMetadata(other.getNestMetadata()); + ecobeeMetadata(other.getEcobeeMetadata()); + honeywellResideoMetadata(other.getHoneywellResideoMetadata()); + hubitatMetadata(other.getHubitatMetadata()); + dormakabaOracodeMetadata(other.getDormakabaOracodeMetadata()); + wyzeMetadata(other.getWyzeMetadata()); + tedeeMetadata(other.getTedeeMetadata()); + experimentalSupportedCodeFromAccessCodesLengths(other.getExperimentalSupportedCodeFromAccessCodesLengths()); + codeConstraints(other.getCodeConstraints()); + supportedCodeLengths(other.getSupportedCodeLengths()); + maxActiveCodesSupported(other.getMaxActiveCodesSupported()); + supportsBackupAccessCodePool(other.getSupportsBackupAccessCodePool()); + hasNativeEntryEvents(other.getHasNativeEntryEvents()); + locked(other.getLocked()); + keypadBattery(other.getKeypadBattery()); + doorOpen(other.getDoorOpen()); + return this; + } + + /** + *

Indicates whether the device is online.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("online") + public NameStage online(boolean online) { + this.online = online; + return this; + } + + /** + *

Name of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public AppearanceStage name(String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("appearance") + public ModelStage appearance(DevicePropertiesAppearance appearance) { + this.appearance = appearance; + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(DevicePropertiesModel model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage doorOpen(Boolean doorOpen) { + this.doorOpen = Optional.of(doorOpen); + return this; + } + + @java.lang.Override + @JsonSetter(value = "door_open", nulls = Nulls.SKIP) + public _FinalStage doorOpen(Optional doorOpen) { + this.doorOpen = doorOpen; + return this; + } + + @java.lang.Override + public _FinalStage keypadBattery(DevicePropertiesKeypadBattery keypadBattery) { + this.keypadBattery = Optional.of(keypadBattery); + return this; + } + + @java.lang.Override + @JsonSetter(value = "keypad_battery", nulls = Nulls.SKIP) + public _FinalStage keypadBattery(Optional keypadBattery) { + this.keypadBattery = keypadBattery; + return this; + } + + @java.lang.Override + public _FinalStage locked(Boolean locked) { + this.locked = Optional.of(locked); + return this; + } + + @java.lang.Override + @JsonSetter(value = "locked", nulls = Nulls.SKIP) + public _FinalStage locked(Optional locked) { + this.locked = locked; + return this; + } + + @java.lang.Override + public _FinalStage hasNativeEntryEvents(Boolean hasNativeEntryEvents) { + this.hasNativeEntryEvents = Optional.of(hasNativeEntryEvents); + return this; + } + + @java.lang.Override + @JsonSetter(value = "has_native_entry_events", nulls = Nulls.SKIP) + public _FinalStage hasNativeEntryEvents(Optional hasNativeEntryEvents) { + this.hasNativeEntryEvents = hasNativeEntryEvents; + return this; + } + + @java.lang.Override + public _FinalStage supportsBackupAccessCodePool(Boolean supportsBackupAccessCodePool) { + this.supportsBackupAccessCodePool = Optional.of(supportsBackupAccessCodePool); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supports_backup_access_code_pool", nulls = Nulls.SKIP) + public _FinalStage supportsBackupAccessCodePool(Optional supportsBackupAccessCodePool) { + this.supportsBackupAccessCodePool = supportsBackupAccessCodePool; + return this; + } + + @java.lang.Override + public _FinalStage maxActiveCodesSupported(Double maxActiveCodesSupported) { + this.maxActiveCodesSupported = Optional.of(maxActiveCodesSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "max_active_codes_supported", nulls = Nulls.SKIP) + public _FinalStage maxActiveCodesSupported(Optional maxActiveCodesSupported) { + this.maxActiveCodesSupported = maxActiveCodesSupported; + return this; + } + + @java.lang.Override + public _FinalStage supportedCodeLengths(List supportedCodeLengths) { + this.supportedCodeLengths = Optional.of(supportedCodeLengths); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_code_lengths", nulls = Nulls.SKIP) + public _FinalStage supportedCodeLengths(Optional> supportedCodeLengths) { + this.supportedCodeLengths = supportedCodeLengths; + return this; + } + + @java.lang.Override + public _FinalStage codeConstraints(List codeConstraints) { + this.codeConstraints = Optional.of(codeConstraints); + return this; + } + + @java.lang.Override + @JsonSetter(value = "code_constraints", nulls = Nulls.SKIP) + public _FinalStage codeConstraints(Optional> codeConstraints) { + this.codeConstraints = codeConstraints; + return this; + } + + @java.lang.Override + public _FinalStage experimentalSupportedCodeFromAccessCodesLengths( + List experimentalSupportedCodeFromAccessCodesLengths) { + this.experimentalSupportedCodeFromAccessCodesLengths = + Optional.of(experimentalSupportedCodeFromAccessCodesLengths); + return this; + } + + @java.lang.Override + @JsonSetter(value = "_experimental_supported_code_from_access_codes_lengths", nulls = Nulls.SKIP) + public _FinalStage experimentalSupportedCodeFromAccessCodesLengths( + Optional> experimentalSupportedCodeFromAccessCodesLengths) { + this.experimentalSupportedCodeFromAccessCodesLengths = experimentalSupportedCodeFromAccessCodesLengths; + return this; + } + + @java.lang.Override + public _FinalStage tedeeMetadata(DevicePropertiesTedeeMetadata tedeeMetadata) { + this.tedeeMetadata = Optional.of(tedeeMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tedee_metadata", nulls = Nulls.SKIP) + public _FinalStage tedeeMetadata(Optional tedeeMetadata) { + this.tedeeMetadata = tedeeMetadata; + return this; + } + + @java.lang.Override + public _FinalStage wyzeMetadata(DevicePropertiesWyzeMetadata wyzeMetadata) { + this.wyzeMetadata = Optional.of(wyzeMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "wyze_metadata", nulls = Nulls.SKIP) + public _FinalStage wyzeMetadata(Optional wyzeMetadata) { + this.wyzeMetadata = wyzeMetadata; + return this; + } + + @java.lang.Override + public _FinalStage dormakabaOracodeMetadata(DevicePropertiesDormakabaOracodeMetadata dormakabaOracodeMetadata) { + this.dormakabaOracodeMetadata = Optional.of(dormakabaOracodeMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "dormakaba_oracode_metadata", nulls = Nulls.SKIP) + public _FinalStage dormakabaOracodeMetadata( + Optional dormakabaOracodeMetadata) { + this.dormakabaOracodeMetadata = dormakabaOracodeMetadata; + return this; + } + + @java.lang.Override + public _FinalStage hubitatMetadata(DevicePropertiesHubitatMetadata hubitatMetadata) { + this.hubitatMetadata = Optional.of(hubitatMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hubitat_metadata", nulls = Nulls.SKIP) + public _FinalStage hubitatMetadata(Optional hubitatMetadata) { + this.hubitatMetadata = hubitatMetadata; + return this; + } + + @java.lang.Override + public _FinalStage honeywellResideoMetadata(DevicePropertiesHoneywellResideoMetadata honeywellResideoMetadata) { + this.honeywellResideoMetadata = Optional.of(honeywellResideoMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "honeywell_resideo_metadata", nulls = Nulls.SKIP) + public _FinalStage honeywellResideoMetadata( + Optional honeywellResideoMetadata) { + this.honeywellResideoMetadata = honeywellResideoMetadata; + return this; + } + + @java.lang.Override + public _FinalStage ecobeeMetadata(DevicePropertiesEcobeeMetadata ecobeeMetadata) { + this.ecobeeMetadata = Optional.of(ecobeeMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ecobee_metadata", nulls = Nulls.SKIP) + public _FinalStage ecobeeMetadata(Optional ecobeeMetadata) { + this.ecobeeMetadata = ecobeeMetadata; + return this; + } + + @java.lang.Override + public _FinalStage nestMetadata(DevicePropertiesNestMetadata nestMetadata) { + this.nestMetadata = Optional.of(nestMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nest_metadata", nulls = Nulls.SKIP) + public _FinalStage nestMetadata(Optional nestMetadata) { + this.nestMetadata = nestMetadata; + return this; + } + + @java.lang.Override + public _FinalStage igloohomeMetadata(DevicePropertiesIgloohomeMetadata igloohomeMetadata) { + this.igloohomeMetadata = Optional.of(igloohomeMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "igloohome_metadata", nulls = Nulls.SKIP) + public _FinalStage igloohomeMetadata(Optional igloohomeMetadata) { + this.igloohomeMetadata = igloohomeMetadata; + return this; + } + + @java.lang.Override + public _FinalStage seamBridgeMetadata(DevicePropertiesSeamBridgeMetadata seamBridgeMetadata) { + this.seamBridgeMetadata = Optional.of(seamBridgeMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "seam_bridge_metadata", nulls = Nulls.SKIP) + public _FinalStage seamBridgeMetadata(Optional seamBridgeMetadata) { + this.seamBridgeMetadata = seamBridgeMetadata; + return this; + } + + @java.lang.Override + public _FinalStage ttlockMetadata(DevicePropertiesTtlockMetadata ttlockMetadata) { + this.ttlockMetadata = Optional.of(ttlockMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "ttlock_metadata", nulls = Nulls.SKIP) + public _FinalStage ttlockMetadata(Optional ttlockMetadata) { + this.ttlockMetadata = ttlockMetadata; + return this; + } + + @java.lang.Override + public _FinalStage controlbywebMetadata(DevicePropertiesControlbywebMetadata controlbywebMetadata) { + this.controlbywebMetadata = Optional.of(controlbywebMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "controlbyweb_metadata", nulls = Nulls.SKIP) + public _FinalStage controlbywebMetadata(Optional controlbywebMetadata) { + this.controlbywebMetadata = controlbywebMetadata; + return this; + } + + @java.lang.Override + public _FinalStage twoNMetadata(DevicePropertiesTwoNMetadata twoNMetadata) { + this.twoNMetadata = Optional.of(twoNMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "two_n_metadata", nulls = Nulls.SKIP) + public _FinalStage twoNMetadata(Optional twoNMetadata) { + this.twoNMetadata = twoNMetadata; + return this; + } + + @java.lang.Override + public _FinalStage fourSuitesMetadata(DevicePropertiesFourSuitesMetadata fourSuitesMetadata) { + this.fourSuitesMetadata = Optional.of(fourSuitesMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "four_suites_metadata", nulls = Nulls.SKIP) + public _FinalStage fourSuitesMetadata(Optional fourSuitesMetadata) { + this.fourSuitesMetadata = fourSuitesMetadata; + return this; + } + + @java.lang.Override + public _FinalStage minutMetadata(DevicePropertiesMinutMetadata minutMetadata) { + this.minutMetadata = Optional.of(minutMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "minut_metadata", nulls = Nulls.SKIP) + public _FinalStage minutMetadata(Optional minutMetadata) { + this.minutMetadata = minutMetadata; + return this; + } + + @java.lang.Override + public _FinalStage noiseawareMetadata(DevicePropertiesNoiseawareMetadata noiseawareMetadata) { + this.noiseawareMetadata = Optional.of(noiseawareMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "noiseaware_metadata", nulls = Nulls.SKIP) + public _FinalStage noiseawareMetadata(Optional noiseawareMetadata) { + this.noiseawareMetadata = noiseawareMetadata; + return this; + } + + @java.lang.Override + public _FinalStage iglooMetadata(DevicePropertiesIglooMetadata iglooMetadata) { + this.iglooMetadata = Optional.of(iglooMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "igloo_metadata", nulls = Nulls.SKIP) + public _FinalStage iglooMetadata(Optional iglooMetadata) { + this.iglooMetadata = iglooMetadata; + return this; + } + + @java.lang.Override + public _FinalStage brivoMetadata(DevicePropertiesBrivoMetadata brivoMetadata) { + this.brivoMetadata = Optional.of(brivoMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "brivo_metadata", nulls = Nulls.SKIP) + public _FinalStage brivoMetadata(Optional brivoMetadata) { + this.brivoMetadata = brivoMetadata; + return this; + } + + @java.lang.Override + public _FinalStage genieMetadata(DevicePropertiesGenieMetadata genieMetadata) { + this.genieMetadata = Optional.of(genieMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "genie_metadata", nulls = Nulls.SKIP) + public _FinalStage genieMetadata(Optional genieMetadata) { + this.genieMetadata = genieMetadata; + return this; + } + + @java.lang.Override + public _FinalStage saltoMetadata(DevicePropertiesSaltoMetadata saltoMetadata) { + this.saltoMetadata = Optional.of(saltoMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "salto_metadata", nulls = Nulls.SKIP) + public _FinalStage saltoMetadata(Optional saltoMetadata) { + this.saltoMetadata = saltoMetadata; + return this; + } + + @java.lang.Override + public _FinalStage kwiksetMetadata(DevicePropertiesKwiksetMetadata kwiksetMetadata) { + this.kwiksetMetadata = Optional.of(kwiksetMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "kwikset_metadata", nulls = Nulls.SKIP) + public _FinalStage kwiksetMetadata(Optional kwiksetMetadata) { + this.kwiksetMetadata = kwiksetMetadata; + return this; + } + + @java.lang.Override + public _FinalStage nukiMetadata(DevicePropertiesNukiMetadata nukiMetadata) { + this.nukiMetadata = Optional.of(nukiMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nuki_metadata", nulls = Nulls.SKIP) + public _FinalStage nukiMetadata(Optional nukiMetadata) { + this.nukiMetadata = nukiMetadata; + return this; + } + + @java.lang.Override + public _FinalStage locklyMetadata(DevicePropertiesLocklyMetadata locklyMetadata) { + this.locklyMetadata = Optional.of(locklyMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "lockly_metadata", nulls = Nulls.SKIP) + public _FinalStage locklyMetadata(Optional locklyMetadata) { + this.locklyMetadata = locklyMetadata; + return this; + } + + @java.lang.Override + public _FinalStage smartthingsMetadata(DevicePropertiesSmartthingsMetadata smartthingsMetadata) { + this.smartthingsMetadata = Optional.of(smartthingsMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "smartthings_metadata", nulls = Nulls.SKIP) + public _FinalStage smartthingsMetadata(Optional smartthingsMetadata) { + this.smartthingsMetadata = smartthingsMetadata; + return this; + } + + @java.lang.Override + public _FinalStage schlageMetadata(DevicePropertiesSchlageMetadata schlageMetadata) { + this.schlageMetadata = Optional.of(schlageMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schlage_metadata", nulls = Nulls.SKIP) + public _FinalStage schlageMetadata(Optional schlageMetadata) { + this.schlageMetadata = schlageMetadata; + return this; + } + + @java.lang.Override + public _FinalStage avigilonAltaMetadata(DevicePropertiesAvigilonAltaMetadata avigilonAltaMetadata) { + this.avigilonAltaMetadata = Optional.of(avigilonAltaMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "avigilon_alta_metadata", nulls = Nulls.SKIP) + public _FinalStage avigilonAltaMetadata(Optional avigilonAltaMetadata) { + this.avigilonAltaMetadata = avigilonAltaMetadata; + return this; + } + + @java.lang.Override + public _FinalStage augustMetadata(DevicePropertiesAugustMetadata augustMetadata) { + this.augustMetadata = Optional.of(augustMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "august_metadata", nulls = Nulls.SKIP) + public _FinalStage augustMetadata(Optional augustMetadata) { + this.augustMetadata = augustMetadata; + return this; + } + + @java.lang.Override + public _FinalStage assaAbloyCredentialServiceMetadata( + DevicePropertiesAssaAbloyCredentialServiceMetadata assaAbloyCredentialServiceMetadata) { + this.assaAbloyCredentialServiceMetadata = Optional.of(assaAbloyCredentialServiceMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "assa_abloy_credential_service_metadata", nulls = Nulls.SKIP) + public _FinalStage assaAbloyCredentialServiceMetadata( + Optional assaAbloyCredentialServiceMetadata) { + this.assaAbloyCredentialServiceMetadata = assaAbloyCredentialServiceMetadata; + return this; + } + + /** + *

Array of noise threshold IDs that are currently triggering.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage currentlyTriggeringNoiseThresholdIds(List currentlyTriggeringNoiseThresholdIds) { + this.currentlyTriggeringNoiseThresholdIds = Optional.of(currentlyTriggeringNoiseThresholdIds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "currently_triggering_noise_threshold_ids", nulls = Nulls.SKIP) + public _FinalStage currentlyTriggeringNoiseThresholdIds( + Optional> currentlyTriggeringNoiseThresholdIds) { + this.currentlyTriggeringNoiseThresholdIds = currentlyTriggeringNoiseThresholdIds; + return this; + } + + /** + *

Indicates current noise level in decibels, if the device supports noise detection.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage noiseLevelDecibels(Double noiseLevelDecibels) { + this.noiseLevelDecibels = Optional.of(noiseLevelDecibels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "noise_level_decibels", nulls = Nulls.SKIP) + public _FinalStage noiseLevelDecibels(Optional noiseLevelDecibels) { + this.noiseLevelDecibels = noiseLevelDecibels; + return this; + } + + @java.lang.Override + public _FinalStage supportsOfflineAccessCodes(Boolean supportsOfflineAccessCodes) { + this.supportsOfflineAccessCodes = Optional.of(supportsOfflineAccessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supports_offline_access_codes", nulls = Nulls.SKIP) + public _FinalStage supportsOfflineAccessCodes(Optional supportsOfflineAccessCodes) { + this.supportsOfflineAccessCodes = supportsOfflineAccessCodes; + return this; + } + + @java.lang.Override + public _FinalStage supportsAccessoryKeypad(Boolean supportsAccessoryKeypad) { + this.supportsAccessoryKeypad = Optional.of(supportsAccessoryKeypad); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supports_accessory_keypad", nulls = Nulls.SKIP) + public _FinalStage supportsAccessoryKeypad(Optional supportsAccessoryKeypad) { + this.supportsAccessoryKeypad = supportsAccessoryKeypad; + return this; + } + + /** + *

Indicates whether it is currently possible to use offline access codes for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage offlineAccessCodesEnabled(Boolean offlineAccessCodesEnabled) { + this.offlineAccessCodesEnabled = Optional.of(offlineAccessCodesEnabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "offline_access_codes_enabled", nulls = Nulls.SKIP) + public _FinalStage offlineAccessCodesEnabled(Optional offlineAccessCodesEnabled) { + this.offlineAccessCodesEnabled = offlineAccessCodesEnabled; + return this; + } + + /** + *

Indicates whether it is currently possible to use online access codes for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage onlineAccessCodesEnabled(Boolean onlineAccessCodesEnabled) { + this.onlineAccessCodesEnabled = Optional.of(onlineAccessCodesEnabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "online_access_codes_enabled", nulls = Nulls.SKIP) + public _FinalStage onlineAccessCodesEnabled(Optional onlineAccessCodesEnabled) { + this.onlineAccessCodesEnabled = onlineAccessCodesEnabled; + return this; + } + + /** + *

Serial number of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage serialNumber(String serialNumber) { + this.serialNumber = Optional.of(serialNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "serial_number", nulls = Nulls.SKIP) + public _FinalStage serialNumber(Optional serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + *

Alt text for the device image.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage imageAltText(String imageAltText) { + this.imageAltText = Optional.of(imageAltText); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image_alt_text", nulls = Nulls.SKIP) + public _FinalStage imageAltText(Optional imageAltText) { + this.imageAltText = imageAltText; + return this; + } + + /** + *

Image URL for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage imageUrl(String imageUrl) { + this.imageUrl = Optional.of(imageUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image_url", nulls = Nulls.SKIP) + public _FinalStage imageUrl(Optional imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + *

Manufacturer of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage manufacturer(String manufacturer) { + this.manufacturer = Optional.of(manufacturer); + return this; + } + + @java.lang.Override + @JsonSetter(value = "manufacturer", nulls = Nulls.SKIP) + public _FinalStage manufacturer(Optional manufacturer) { + this.manufacturer = manufacturer; + return this; + } + + /** + *

Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage battery(DevicePropertiesBattery battery) { + this.battery = Optional.of(battery); + return this; + } + + @java.lang.Override + @JsonSetter(value = "battery", nulls = Nulls.SKIP) + public _FinalStage battery(Optional battery) { + this.battery = battery; + return this; + } + + /** + *

Indicates the battery level of the device as a decimal value between 0 and 1, inclusive.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage batteryLevel(Double batteryLevel) { + this.batteryLevel = Optional.of(batteryLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "battery_level", nulls = Nulls.SKIP) + public _FinalStage batteryLevel(Optional batteryLevel) { + this.batteryLevel = batteryLevel; + return this; + } + + /** + *

Indicates whether the device has direct power.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hasDirectPower(Boolean hasDirectPower) { + this.hasDirectPower = Optional.of(hasDirectPower); + return this; + } + + @java.lang.Override + @JsonSetter(value = "has_direct_power", nulls = Nulls.SKIP) + public _FinalStage hasDirectPower(Optional hasDirectPower) { + this.hasDirectPower = hasDirectPower; + return this; + } + + /** + *

Represents the accessory keypad state.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage accessoryKeypad(DevicePropertiesAccessoryKeypad accessoryKeypad) { + this.accessoryKeypad = Optional.of(accessoryKeypad); + return this; + } + + @java.lang.Override + @JsonSetter(value = "accessory_keypad", nulls = Nulls.SKIP) + public _FinalStage accessoryKeypad(Optional accessoryKeypad) { + this.accessoryKeypad = accessoryKeypad; return this; } - @Override + @java.lang.Override public DeviceProperties build() { return new DeviceProperties( online, name, + accessoryKeypad, + appearance, model, + hasDirectPower, + batteryLevel, + battery, + manufacturer, + imageUrl, + imageAltText, + serialNumber, + onlineAccessCodesEnabled, + offlineAccessCodesEnabled, + supportsAccessoryKeypad, + supportsOfflineAccessCodes, + noiseLevelDecibels, + currentlyTriggeringNoiseThresholdIds, + assaAbloyCredentialServiceMetadata, augustMetadata, + avigilonAltaMetadata, schlageMetadata, smartthingsMetadata, - currentClimateSetting, + locklyMetadata, + nukiMetadata, + kwiksetMetadata, + saltoMetadata, + genieMetadata, + brivoMetadata, + iglooMetadata, + noiseawareMetadata, + minutMetadata, + fourSuitesMetadata, + twoNMetadata, + controlbywebMetadata, + ttlockMetadata, + seamBridgeMetadata, + igloohomeMetadata, + nestMetadata, + ecobeeMetadata, + honeywellResideoMetadata, + hubitatMetadata, + dormakabaOracodeMetadata, + wyzeMetadata, + tedeeMetadata, + experimentalSupportedCodeFromAccessCodesLengths, + codeConstraints, + supportedCodeLengths, + maxActiveCodesSupported, + supportsBackupAccessCodePool, + hasNativeEntryEvents, + locked, + keypadBattery, + doorOpen, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypad.java b/src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypad.java new file mode 100644 index 0000000..ac94079 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypad.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesAccessoryKeypad.Builder.class) +public final class DevicePropertiesAccessoryKeypad { + private final boolean isConnected; + + private final Optional battery; + + private final Map additionalProperties; + + private DevicePropertiesAccessoryKeypad( + boolean isConnected, + Optional battery, + Map additionalProperties) { + this.isConnected = isConnected; + this.battery = battery; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates if the accessory_keypad is connected to the device. + */ + @JsonProperty("is_connected") + public boolean getIsConnected() { + return isConnected; + } + + /** + * @return Indicates if the keypad battery properties. + */ + @JsonProperty("battery") + public Optional getBattery() { + return battery; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesAccessoryKeypad && equalTo((DevicePropertiesAccessoryKeypad) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesAccessoryKeypad other) { + return isConnected == other.isConnected && battery.equals(other.battery); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isConnected, this.battery); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IsConnectedStage builder() { + return new Builder(); + } + + public interface IsConnectedStage { + _FinalStage isConnected(boolean isConnected); + + Builder from(DevicePropertiesAccessoryKeypad other); + } + + public interface _FinalStage { + DevicePropertiesAccessoryKeypad build(); + + _FinalStage battery(Optional battery); + + _FinalStage battery(DevicePropertiesAccessoryKeypadBattery battery); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IsConnectedStage, _FinalStage { + private boolean isConnected; + + private Optional battery = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesAccessoryKeypad other) { + isConnected(other.getIsConnected()); + battery(other.getBattery()); + return this; + } + + /** + *

Indicates if the accessory_keypad is connected to the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_connected") + public _FinalStage isConnected(boolean isConnected) { + this.isConnected = isConnected; + return this; + } + + /** + *

Indicates if the keypad battery properties.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage battery(DevicePropertiesAccessoryKeypadBattery battery) { + this.battery = Optional.of(battery); + return this; + } + + @java.lang.Override + @JsonSetter(value = "battery", nulls = Nulls.SKIP) + public _FinalStage battery(Optional battery) { + this.battery = battery; + return this; + } + + @java.lang.Override + public DevicePropertiesAccessoryKeypad build() { + return new DevicePropertiesAccessoryKeypad(isConnected, battery, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypadBattery.java b/src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypadBattery.java new file mode 100644 index 0000000..cc77484 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesAccessoryKeypadBattery.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesAccessoryKeypadBattery.Builder.class) +public final class DevicePropertiesAccessoryKeypadBattery { + private final double level; + + private final Map additionalProperties; + + private DevicePropertiesAccessoryKeypadBattery(double level, Map additionalProperties) { + this.level = level; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("level") + public double getLevel() { + return level; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesAccessoryKeypadBattery + && equalTo((DevicePropertiesAccessoryKeypadBattery) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesAccessoryKeypadBattery other) { + return level == other.level; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.level); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LevelStage builder() { + return new Builder(); + } + + public interface LevelStage { + _FinalStage level(double level); + + Builder from(DevicePropertiesAccessoryKeypadBattery other); + } + + public interface _FinalStage { + DevicePropertiesAccessoryKeypadBattery build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LevelStage, _FinalStage { + private double level; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesAccessoryKeypadBattery other) { + level(other.getLevel()); + return this; + } + + @java.lang.Override + @JsonSetter("level") + public _FinalStage level(double level) { + this.level = level; + return this; + } + + @java.lang.Override + public DevicePropertiesAccessoryKeypadBattery build() { + return new DevicePropertiesAccessoryKeypadBattery(level, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesAppearance.java b/src/main/java/com/seam/api/types/DevicePropertiesAppearance.java new file mode 100644 index 0000000..9dc01a7 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesAppearance.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesAppearance.Builder.class) +public final class DevicePropertiesAppearance { + private final String name; + + private final Map additionalProperties; + + private DevicePropertiesAppearance(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the device as seen from the provider API and application, not settable through Seam. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesAppearance && equalTo((DevicePropertiesAppearance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesAppearance other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(String name); + + Builder from(DevicePropertiesAppearance other); + } + + public interface _FinalStage { + DevicePropertiesAppearance build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesAppearance other) { + name(other.getName()); + return this; + } + + /** + *

Name of the device as seen from the provider API and application, not settable through Seam.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(String name) { + this.name = name; + return this; + } + + @java.lang.Override + public DevicePropertiesAppearance build() { + return new DevicePropertiesAppearance(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadata.java new file mode 100644 index 0000000..340d6af --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadata.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesAssaAbloyCredentialServiceMetadata.Builder.class) +public final class DevicePropertiesAssaAbloyCredentialServiceMetadata { + private final boolean hasActiveEndpoint; + + private final List endpoints; + + private final Map additionalProperties; + + private DevicePropertiesAssaAbloyCredentialServiceMetadata( + boolean hasActiveEndpoint, + List endpoints, + Map additionalProperties) { + this.hasActiveEndpoint = hasActiveEndpoint; + this.endpoints = endpoints; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("has_active_endpoint") + public boolean getHasActiveEndpoint() { + return hasActiveEndpoint; + } + + @JsonProperty("endpoints") + public List getEndpoints() { + return endpoints; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesAssaAbloyCredentialServiceMetadata + && equalTo((DevicePropertiesAssaAbloyCredentialServiceMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesAssaAbloyCredentialServiceMetadata other) { + return hasActiveEndpoint == other.hasActiveEndpoint && endpoints.equals(other.endpoints); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hasActiveEndpoint, this.endpoints); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasActiveEndpointStage builder() { + return new Builder(); + } + + public interface HasActiveEndpointStage { + _FinalStage hasActiveEndpoint(boolean hasActiveEndpoint); + + Builder from(DevicePropertiesAssaAbloyCredentialServiceMetadata other); + } + + public interface _FinalStage { + DevicePropertiesAssaAbloyCredentialServiceMetadata build(); + + _FinalStage endpoints(List endpoints); + + _FinalStage addEndpoints(DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem endpoints); + + _FinalStage addAllEndpoints(List endpoints); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HasActiveEndpointStage, _FinalStage { + private boolean hasActiveEndpoint; + + private List endpoints = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesAssaAbloyCredentialServiceMetadata other) { + hasActiveEndpoint(other.getHasActiveEndpoint()); + endpoints(other.getEndpoints()); + return this; + } + + @java.lang.Override + @JsonSetter("has_active_endpoint") + public _FinalStage hasActiveEndpoint(boolean hasActiveEndpoint) { + this.hasActiveEndpoint = hasActiveEndpoint; + return this; + } + + @java.lang.Override + public _FinalStage addAllEndpoints( + List endpoints) { + this.endpoints.addAll(endpoints); + return this; + } + + @java.lang.Override + public _FinalStage addEndpoints(DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem endpoints) { + this.endpoints.add(endpoints); + return this; + } + + @java.lang.Override + @JsonSetter(value = "endpoints", nulls = Nulls.SKIP) + public _FinalStage endpoints(List endpoints) { + this.endpoints.clear(); + this.endpoints.addAll(endpoints); + return this; + } + + @java.lang.Override + public DevicePropertiesAssaAbloyCredentialServiceMetadata build() { + return new DevicePropertiesAssaAbloyCredentialServiceMetadata( + hasActiveEndpoint, endpoints, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java b/src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java new file mode 100644 index 0000000..2d47baa --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.Builder.class) +public final class DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem { + private final String endpointId; + + private final boolean isActive; + + private final Map additionalProperties; + + private DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem( + String endpointId, boolean isActive, Map additionalProperties) { + this.endpointId = endpointId; + this.isActive = isActive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("endpoint_id") + public String getEndpointId() { + return endpointId; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem + && equalTo((DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem other) { + return endpointId.equals(other.endpointId) && isActive == other.isActive; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.endpointId, this.isActive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndpointIdStage builder() { + return new Builder(); + } + + public interface EndpointIdStage { + IsActiveStage endpointId(String endpointId); + + Builder from(DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EndpointIdStage, IsActiveStage, _FinalStage { + private String endpointId; + + private boolean isActive; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem other) { + endpointId(other.getEndpointId()); + isActive(other.getIsActive()); + return this; + } + + @java.lang.Override + @JsonSetter("endpoint_id") + public IsActiveStage endpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem build() { + return new DevicePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem( + endpointId, isActive, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/AugustDeviceMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesAugustMetadata.java similarity index 84% rename from src/main/java/com/seam/api/types/AugustDeviceMetadata.java rename to src/main/java/com/seam/api/types/DevicePropertiesAugustMetadata.java index e03b10e..2d7c241 100644 --- a/src/main/java/com/seam/api/types/AugustDeviceMetadata.java +++ b/src/main/java/com/seam/api/types/DevicePropertiesAugustMetadata.java @@ -18,40 +18,40 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = AugustDeviceMetadata.Builder.class) -public final class AugustDeviceMetadata { +@JsonDeserialize(builder = DevicePropertiesAugustMetadata.Builder.class) +public final class DevicePropertiesAugustMetadata { private final String lockId; private final String lockName; private final String houseName; - private final Optional houseId; - private final boolean hasKeypad; + private final Optional keypadBatteryLevel; + private final Optional model; - private final Optional keypadBatteryLevel; + private final Optional houseId; private final Map additionalProperties; - private AugustDeviceMetadata( + private DevicePropertiesAugustMetadata( String lockId, String lockName, String houseName, - Optional houseId, boolean hasKeypad, - Optional model, Optional keypadBatteryLevel, + Optional model, + Optional houseId, Map additionalProperties) { this.lockId = lockId; this.lockName = lockName; this.houseName = houseName; - this.houseId = houseId; this.hasKeypad = hasKeypad; - this.model = model; this.keypadBatteryLevel = keypadBatteryLevel; + this.model = model; + this.houseId = houseId; this.additionalProperties = additionalProperties; } @@ -70,30 +70,30 @@ public String getHouseName() { return houseName; } - @JsonProperty("house_id") - public Optional getHouseId() { - return houseId; - } - @JsonProperty("has_keypad") public boolean getHasKeypad() { return hasKeypad; } + @JsonProperty("keypad_battery_level") + public Optional getKeypadBatteryLevel() { + return keypadBatteryLevel; + } + @JsonProperty("model") public Optional getModel() { return model; } - @JsonProperty("keypad_battery_level") - public Optional getKeypadBatteryLevel() { - return keypadBatteryLevel; + @JsonProperty("house_id") + public Optional getHouseId() { + return houseId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof AugustDeviceMetadata && equalTo((AugustDeviceMetadata) other); + return other instanceof DevicePropertiesAugustMetadata && equalTo((DevicePropertiesAugustMetadata) other); } @JsonAnyGetter @@ -101,29 +101,29 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(AugustDeviceMetadata other) { + private boolean equalTo(DevicePropertiesAugustMetadata other) { return lockId.equals(other.lockId) && lockName.equals(other.lockName) && houseName.equals(other.houseName) - && houseId.equals(other.houseId) && hasKeypad == other.hasKeypad + && keypadBatteryLevel.equals(other.keypadBatteryLevel) && model.equals(other.model) - && keypadBatteryLevel.equals(other.keypadBatteryLevel); + && houseId.equals(other.houseId); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.lockId, this.lockName, this.houseName, - this.houseId, this.hasKeypad, + this.keypadBatteryLevel, this.model, - this.keypadBatteryLevel); + this.houseId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -135,7 +135,7 @@ public static LockIdStage builder() { public interface LockIdStage { LockNameStage lockId(String lockId); - Builder from(AugustDeviceMetadata other); + Builder from(DevicePropertiesAugustMetadata other); } public interface LockNameStage { @@ -151,19 +151,19 @@ public interface HasKeypadStage { } public interface _FinalStage { - AugustDeviceMetadata build(); + DevicePropertiesAugustMetadata build(); - _FinalStage houseId(Optional houseId); + _FinalStage keypadBatteryLevel(Optional keypadBatteryLevel); - _FinalStage houseId(String houseId); + _FinalStage keypadBatteryLevel(String keypadBatteryLevel); _FinalStage model(Optional model); _FinalStage model(String model); - _FinalStage keypadBatteryLevel(Optional keypadBatteryLevel); + _FinalStage houseId(Optional houseId); - _FinalStage keypadBatteryLevel(String keypadBatteryLevel); + _FinalStage houseId(String houseId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -177,100 +177,100 @@ public static final class Builder private boolean hasKeypad; - private Optional keypadBatteryLevel = Optional.empty(); + private Optional houseId = Optional.empty(); private Optional model = Optional.empty(); - private Optional houseId = Optional.empty(); + private Optional keypadBatteryLevel = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override - public Builder from(AugustDeviceMetadata other) { + @java.lang.Override + public Builder from(DevicePropertiesAugustMetadata other) { lockId(other.getLockId()); lockName(other.getLockName()); houseName(other.getHouseName()); - houseId(other.getHouseId()); hasKeypad(other.getHasKeypad()); - model(other.getModel()); keypadBatteryLevel(other.getKeypadBatteryLevel()); + model(other.getModel()); + houseId(other.getHouseId()); return this; } - @Override + @java.lang.Override @JsonSetter("lock_id") public LockNameStage lockId(String lockId) { this.lockId = lockId; return this; } - @Override + @java.lang.Override @JsonSetter("lock_name") public HouseNameStage lockName(String lockName) { this.lockName = lockName; return this; } - @Override + @java.lang.Override @JsonSetter("house_name") public HasKeypadStage houseName(String houseName) { this.houseName = houseName; return this; } - @Override + @java.lang.Override @JsonSetter("has_keypad") public _FinalStage hasKeypad(boolean hasKeypad) { this.hasKeypad = hasKeypad; return this; } - @Override - public _FinalStage keypadBatteryLevel(String keypadBatteryLevel) { - this.keypadBatteryLevel = Optional.of(keypadBatteryLevel); + @java.lang.Override + public _FinalStage houseId(String houseId) { + this.houseId = Optional.of(houseId); return this; } - @Override - @JsonSetter(value = "keypad_battery_level", nulls = Nulls.SKIP) - public _FinalStage keypadBatteryLevel(Optional keypadBatteryLevel) { - this.keypadBatteryLevel = keypadBatteryLevel; + @java.lang.Override + @JsonSetter(value = "house_id", nulls = Nulls.SKIP) + public _FinalStage houseId(Optional houseId) { + this.houseId = houseId; return this; } - @Override + @java.lang.Override public _FinalStage model(String model) { this.model = Optional.of(model); return this; } - @Override + @java.lang.Override @JsonSetter(value = "model", nulls = Nulls.SKIP) public _FinalStage model(Optional model) { this.model = model; return this; } - @Override - public _FinalStage houseId(String houseId) { - this.houseId = Optional.of(houseId); + @java.lang.Override + public _FinalStage keypadBatteryLevel(String keypadBatteryLevel) { + this.keypadBatteryLevel = Optional.of(keypadBatteryLevel); return this; } - @Override - @JsonSetter(value = "house_id", nulls = Nulls.SKIP) - public _FinalStage houseId(Optional houseId) { - this.houseId = houseId; + @java.lang.Override + @JsonSetter(value = "keypad_battery_level", nulls = Nulls.SKIP) + public _FinalStage keypadBatteryLevel(Optional keypadBatteryLevel) { + this.keypadBatteryLevel = keypadBatteryLevel; return this; } - @Override - public AugustDeviceMetadata build() { - return new AugustDeviceMetadata( - lockId, lockName, houseName, houseId, hasKeypad, model, keypadBatteryLevel, additionalProperties); + @java.lang.Override + public DevicePropertiesAugustMetadata build() { + return new DevicePropertiesAugustMetadata( + lockId, lockName, houseName, hasKeypad, keypadBatteryLevel, model, houseId, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/DevicePropertiesAvigilonAltaMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesAvigilonAltaMetadata.java new file mode 100644 index 0000000..0140f53 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesAvigilonAltaMetadata.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesAvigilonAltaMetadata.Builder.class) +public final class DevicePropertiesAvigilonAltaMetadata { + private final String entryName; + + private final String orgName; + + private final double zoneId; + + private final String zoneName; + + private final double siteId; + + private final String siteName; + + private final double entryRelaysTotalCount; + + private final Map additionalProperties; + + private DevicePropertiesAvigilonAltaMetadata( + String entryName, + String orgName, + double zoneId, + String zoneName, + double siteId, + String siteName, + double entryRelaysTotalCount, + Map additionalProperties) { + this.entryName = entryName; + this.orgName = orgName; + this.zoneId = zoneId; + this.zoneName = zoneName; + this.siteId = siteId; + this.siteName = siteName; + this.entryRelaysTotalCount = entryRelaysTotalCount; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("entry_name") + public String getEntryName() { + return entryName; + } + + @JsonProperty("org_name") + public String getOrgName() { + return orgName; + } + + @JsonProperty("zone_id") + public double getZoneId() { + return zoneId; + } + + @JsonProperty("zone_name") + public String getZoneName() { + return zoneName; + } + + @JsonProperty("site_id") + public double getSiteId() { + return siteId; + } + + @JsonProperty("site_name") + public String getSiteName() { + return siteName; + } + + @JsonProperty("entry_relays_total_count") + public double getEntryRelaysTotalCount() { + return entryRelaysTotalCount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesAvigilonAltaMetadata + && equalTo((DevicePropertiesAvigilonAltaMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesAvigilonAltaMetadata other) { + return entryName.equals(other.entryName) + && orgName.equals(other.orgName) + && zoneId == other.zoneId + && zoneName.equals(other.zoneName) + && siteId == other.siteId + && siteName.equals(other.siteName) + && entryRelaysTotalCount == other.entryRelaysTotalCount; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.entryName, + this.orgName, + this.zoneId, + this.zoneName, + this.siteId, + this.siteName, + this.entryRelaysTotalCount); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EntryNameStage builder() { + return new Builder(); + } + + public interface EntryNameStage { + OrgNameStage entryName(String entryName); + + Builder from(DevicePropertiesAvigilonAltaMetadata other); + } + + public interface OrgNameStage { + ZoneIdStage orgName(String orgName); + } + + public interface ZoneIdStage { + ZoneNameStage zoneId(double zoneId); + } + + public interface ZoneNameStage { + SiteIdStage zoneName(String zoneName); + } + + public interface SiteIdStage { + SiteNameStage siteId(double siteId); + } + + public interface SiteNameStage { + EntryRelaysTotalCountStage siteName(String siteName); + } + + public interface EntryRelaysTotalCountStage { + _FinalStage entryRelaysTotalCount(double entryRelaysTotalCount); + } + + public interface _FinalStage { + DevicePropertiesAvigilonAltaMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EntryNameStage, + OrgNameStage, + ZoneIdStage, + ZoneNameStage, + SiteIdStage, + SiteNameStage, + EntryRelaysTotalCountStage, + _FinalStage { + private String entryName; + + private String orgName; + + private double zoneId; + + private String zoneName; + + private double siteId; + + private String siteName; + + private double entryRelaysTotalCount; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesAvigilonAltaMetadata other) { + entryName(other.getEntryName()); + orgName(other.getOrgName()); + zoneId(other.getZoneId()); + zoneName(other.getZoneName()); + siteId(other.getSiteId()); + siteName(other.getSiteName()); + entryRelaysTotalCount(other.getEntryRelaysTotalCount()); + return this; + } + + @java.lang.Override + @JsonSetter("entry_name") + public OrgNameStage entryName(String entryName) { + this.entryName = entryName; + return this; + } + + @java.lang.Override + @JsonSetter("org_name") + public ZoneIdStage orgName(String orgName) { + this.orgName = orgName; + return this; + } + + @java.lang.Override + @JsonSetter("zone_id") + public ZoneNameStage zoneId(double zoneId) { + this.zoneId = zoneId; + return this; + } + + @java.lang.Override + @JsonSetter("zone_name") + public SiteIdStage zoneName(String zoneName) { + this.zoneName = zoneName; + return this; + } + + @java.lang.Override + @JsonSetter("site_id") + public SiteNameStage siteId(double siteId) { + this.siteId = siteId; + return this; + } + + @java.lang.Override + @JsonSetter("site_name") + public EntryRelaysTotalCountStage siteName(String siteName) { + this.siteName = siteName; + return this; + } + + @java.lang.Override + @JsonSetter("entry_relays_total_count") + public _FinalStage entryRelaysTotalCount(double entryRelaysTotalCount) { + this.entryRelaysTotalCount = entryRelaysTotalCount; + return this; + } + + @java.lang.Override + public DevicePropertiesAvigilonAltaMetadata build() { + return new DevicePropertiesAvigilonAltaMetadata( + entryName, + orgName, + zoneId, + zoneName, + siteId, + siteName, + entryRelaysTotalCount, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesBattery.java b/src/main/java/com/seam/api/types/DevicePropertiesBattery.java new file mode 100644 index 0000000..d1d2855 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesBattery.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesBattery.Builder.class) +public final class DevicePropertiesBattery { + private final double level; + + private final DevicePropertiesBatteryStatus status; + + private final Map additionalProperties; + + private DevicePropertiesBattery( + double level, DevicePropertiesBatteryStatus status, Map additionalProperties) { + this.level = level; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("level") + public double getLevel() { + return level; + } + + @JsonProperty("status") + public DevicePropertiesBatteryStatus getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesBattery && equalTo((DevicePropertiesBattery) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesBattery other) { + return level == other.level && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.level, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LevelStage builder() { + return new Builder(); + } + + public interface LevelStage { + StatusStage level(double level); + + Builder from(DevicePropertiesBattery other); + } + + public interface StatusStage { + _FinalStage status(DevicePropertiesBatteryStatus status); + } + + public interface _FinalStage { + DevicePropertiesBattery build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LevelStage, StatusStage, _FinalStage { + private double level; + + private DevicePropertiesBatteryStatus status; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesBattery other) { + level(other.getLevel()); + status(other.getStatus()); + return this; + } + + @java.lang.Override + @JsonSetter("level") + public StatusStage level(double level) { + this.level = level; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(DevicePropertiesBatteryStatus status) { + this.status = status; + return this; + } + + @java.lang.Override + public DevicePropertiesBattery build() { + return new DevicePropertiesBattery(level, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesBatteryStatus.java b/src/main/java/com/seam/api/types/DevicePropertiesBatteryStatus.java new file mode 100644 index 0000000..ae94550 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesBatteryStatus.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DevicePropertiesBatteryStatus { + CRITICAL("critical"), + + LOW("low"), + + GOOD("good"), + + FULL("full"); + + private final String value; + + DevicePropertiesBatteryStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesBrivoMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesBrivoMetadata.java new file mode 100644 index 0000000..515bb52 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesBrivoMetadata.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesBrivoMetadata.Builder.class) +public final class DevicePropertiesBrivoMetadata { + private final String deviceName; + + private final Map additionalProperties; + + private DevicePropertiesBrivoMetadata(String deviceName, Map additionalProperties) { + this.deviceName = deviceName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesBrivoMetadata && equalTo((DevicePropertiesBrivoMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesBrivoMetadata other) { + return deviceName.equals(other.deviceName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceNameStage builder() { + return new Builder(); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + + Builder from(DevicePropertiesBrivoMetadata other); + } + + public interface _FinalStage { + DevicePropertiesBrivoMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceNameStage, _FinalStage { + private String deviceName; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesBrivoMetadata other) { + deviceName(other.getDeviceName()); + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public DevicePropertiesBrivoMetadata build() { + return new DevicePropertiesBrivoMetadata(deviceName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItem.java b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItem.java new file mode 100644 index 0000000..51d0414 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItem.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DevicePropertiesCodeConstraintsItem.Deserializer.class) +public final class DevicePropertiesCodeConstraintsItem { + private final Object value; + + private final int type; + + private DevicePropertiesCodeConstraintsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((DevicePropertiesCodeConstraintsItemZero) this.value); + } else if (this.type == 1) { + return visitor.visit((DevicePropertiesCodeConstraintsItemMaxLength) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesCodeConstraintsItem + && equalTo((DevicePropertiesCodeConstraintsItem) other); + } + + private boolean equalTo(DevicePropertiesCodeConstraintsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DevicePropertiesCodeConstraintsItem of(DevicePropertiesCodeConstraintsItemZero value) { + return new DevicePropertiesCodeConstraintsItem(value, 0); + } + + public static DevicePropertiesCodeConstraintsItem of(DevicePropertiesCodeConstraintsItemMaxLength value) { + return new DevicePropertiesCodeConstraintsItem(value, 1); + } + + public interface Visitor { + T visit(DevicePropertiesCodeConstraintsItemZero value); + + T visit(DevicePropertiesCodeConstraintsItemMaxLength value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DevicePropertiesCodeConstraintsItem.class); + } + + @java.lang.Override + public DevicePropertiesCodeConstraintsItem deserialize(JsonParser p, DeserializationContext ctxt) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, DevicePropertiesCodeConstraintsItemZero.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, DevicePropertiesCodeConstraintsItemMaxLength.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLength.java b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLength.java new file mode 100644 index 0000000..bab3748 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLength.java @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesCodeConstraintsItemMaxLength.Builder.class) +public final class DevicePropertiesCodeConstraintsItemMaxLength { + private final DevicePropertiesCodeConstraintsItemMaxLengthConstraintType constraintType; + + private final Optional minLength; + + private final Optional maxLength; + + private final Map additionalProperties; + + private DevicePropertiesCodeConstraintsItemMaxLength( + DevicePropertiesCodeConstraintsItemMaxLengthConstraintType constraintType, + Optional minLength, + Optional maxLength, + Map additionalProperties) { + this.constraintType = constraintType; + this.minLength = minLength; + this.maxLength = maxLength; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("constraint_type") + public DevicePropertiesCodeConstraintsItemMaxLengthConstraintType getConstraintType() { + return constraintType; + } + + @JsonProperty("min_length") + public Optional getMinLength() { + return minLength; + } + + @JsonProperty("max_length") + public Optional getMaxLength() { + return maxLength; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesCodeConstraintsItemMaxLength + && equalTo((DevicePropertiesCodeConstraintsItemMaxLength) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesCodeConstraintsItemMaxLength other) { + return constraintType.equals(other.constraintType) + && minLength.equals(other.minLength) + && maxLength.equals(other.maxLength); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.constraintType, this.minLength, this.maxLength); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConstraintTypeStage builder() { + return new Builder(); + } + + public interface ConstraintTypeStage { + _FinalStage constraintType(DevicePropertiesCodeConstraintsItemMaxLengthConstraintType constraintType); + + Builder from(DevicePropertiesCodeConstraintsItemMaxLength other); + } + + public interface _FinalStage { + DevicePropertiesCodeConstraintsItemMaxLength build(); + + _FinalStage minLength(Optional minLength); + + _FinalStage minLength(Double minLength); + + _FinalStage maxLength(Optional maxLength); + + _FinalStage maxLength(Double maxLength); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConstraintTypeStage, _FinalStage { + private DevicePropertiesCodeConstraintsItemMaxLengthConstraintType constraintType; + + private Optional maxLength = Optional.empty(); + + private Optional minLength = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesCodeConstraintsItemMaxLength other) { + constraintType(other.getConstraintType()); + minLength(other.getMinLength()); + maxLength(other.getMaxLength()); + return this; + } + + @java.lang.Override + @JsonSetter("constraint_type") + public _FinalStage constraintType(DevicePropertiesCodeConstraintsItemMaxLengthConstraintType constraintType) { + this.constraintType = constraintType; + return this; + } + + @java.lang.Override + public _FinalStage maxLength(Double maxLength) { + this.maxLength = Optional.of(maxLength); + return this; + } + + @java.lang.Override + @JsonSetter(value = "max_length", nulls = Nulls.SKIP) + public _FinalStage maxLength(Optional maxLength) { + this.maxLength = maxLength; + return this; + } + + @java.lang.Override + public _FinalStage minLength(Double minLength) { + this.minLength = Optional.of(minLength); + return this; + } + + @java.lang.Override + @JsonSetter(value = "min_length", nulls = Nulls.SKIP) + public _FinalStage minLength(Optional minLength) { + this.minLength = minLength; + return this; + } + + @java.lang.Override + public DevicePropertiesCodeConstraintsItemMaxLength build() { + return new DevicePropertiesCodeConstraintsItemMaxLength( + constraintType, minLength, maxLength, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLengthConstraintType.java b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLengthConstraintType.java new file mode 100644 index 0000000..557d8e6 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemMaxLengthConstraintType.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DevicePropertiesCodeConstraintsItemMaxLengthConstraintType { + NAME_LENGTH("name_length"), + + NAME_MUST_BE_UNIQUE("name_must_be_unique"); + + private final String value; + + DevicePropertiesCodeConstraintsItemMaxLengthConstraintType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZero.java b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZero.java new file mode 100644 index 0000000..fe4ebd1 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZero.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesCodeConstraintsItemZero.Builder.class) +public final class DevicePropertiesCodeConstraintsItemZero { + private final DevicePropertiesCodeConstraintsItemZeroConstraintType constraintType; + + private final Map additionalProperties; + + private DevicePropertiesCodeConstraintsItemZero( + DevicePropertiesCodeConstraintsItemZeroConstraintType constraintType, + Map additionalProperties) { + this.constraintType = constraintType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("constraint_type") + public DevicePropertiesCodeConstraintsItemZeroConstraintType getConstraintType() { + return constraintType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesCodeConstraintsItemZero + && equalTo((DevicePropertiesCodeConstraintsItemZero) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesCodeConstraintsItemZero other) { + return constraintType.equals(other.constraintType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.constraintType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ConstraintTypeStage builder() { + return new Builder(); + } + + public interface ConstraintTypeStage { + _FinalStage constraintType(DevicePropertiesCodeConstraintsItemZeroConstraintType constraintType); + + Builder from(DevicePropertiesCodeConstraintsItemZero other); + } + + public interface _FinalStage { + DevicePropertiesCodeConstraintsItemZero build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ConstraintTypeStage, _FinalStage { + private DevicePropertiesCodeConstraintsItemZeroConstraintType constraintType; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesCodeConstraintsItemZero other) { + constraintType(other.getConstraintType()); + return this; + } + + @java.lang.Override + @JsonSetter("constraint_type") + public _FinalStage constraintType(DevicePropertiesCodeConstraintsItemZeroConstraintType constraintType) { + this.constraintType = constraintType; + return this; + } + + @java.lang.Override + public DevicePropertiesCodeConstraintsItemZero build() { + return new DevicePropertiesCodeConstraintsItemZero(constraintType, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZeroConstraintType.java b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZeroConstraintType.java new file mode 100644 index 0000000..edfc726 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesCodeConstraintsItemZeroConstraintType.java @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DevicePropertiesCodeConstraintsItemZeroConstraintType { + NO_ZEROS("no_zeros"), + + CANNOT_START_WITH_12("cannot_start_with_12"), + + NO_TRIPLE_CONSECUTIVE_INTS("no_triple_consecutive_ints"), + + CANNOT_SPECIFY_PIN_CODE("cannot_specify_pin_code"), + + PIN_CODE_MATCHES_EXISTING_SET("pin_code_matches_existing_set"), + + START_DATE_IN_FUTURE("start_date_in_future"), + + NO_ASCENDING_OR_DESCENDING_SEQUENCE("no_ascending_or_descending_sequence"), + + AT_LEAST_THREE_UNIQUE_DIGITS("at_least_three_unique_digits"), + + CANNOT_CONTAIN_089("cannot_contain_089"); + + private final String value; + + DevicePropertiesCodeConstraintsItemZeroConstraintType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesControlbywebMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesControlbywebMetadata.java new file mode 100644 index 0000000..4a6ef02 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesControlbywebMetadata.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesControlbywebMetadata.Builder.class) +public final class DevicePropertiesControlbywebMetadata { + private final String deviceId; + + private final String deviceName; + + private final Optional relayName; + + private final Map additionalProperties; + + private DevicePropertiesControlbywebMetadata( + String deviceId, String deviceName, Optional relayName, Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.relayName = relayName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("relay_name") + public Optional getRelayName() { + return relayName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesControlbywebMetadata + && equalTo((DevicePropertiesControlbywebMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesControlbywebMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && relayName.equals(other.relayName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.relayName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesControlbywebMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesControlbywebMetadata build(); + + _FinalStage relayName(Optional relayName); + + _FinalStage relayName(String relayName); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private Optional relayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesControlbywebMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + relayName(other.getRelayName()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public _FinalStage relayName(String relayName) { + this.relayName = Optional.of(relayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "relay_name", nulls = Nulls.SKIP) + public _FinalStage relayName(Optional relayName) { + this.relayName = relayName; + return this; + } + + @java.lang.Override + public DevicePropertiesControlbywebMetadata build() { + return new DevicePropertiesControlbywebMetadata(deviceId, deviceName, relayName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadata.java new file mode 100644 index 0000000..bb9b610 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadata.java @@ -0,0 +1,316 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesDormakabaOracodeMetadata.Builder.class) +public final class DevicePropertiesDormakabaOracodeMetadata { + private final double doorId; + + private final String doorName; + + private final Optional deviceId; + + private final boolean doorIsWireless; + + private final double siteId; + + private final String siteName; + + private final Optional ianaTimezone; + + private final Optional> predefinedTimeSlots; + + private final Map additionalProperties; + + private DevicePropertiesDormakabaOracodeMetadata( + double doorId, + String doorName, + Optional deviceId, + boolean doorIsWireless, + double siteId, + String siteName, + Optional ianaTimezone, + Optional> predefinedTimeSlots, + Map additionalProperties) { + this.doorId = doorId; + this.doorName = doorName; + this.deviceId = deviceId; + this.doorIsWireless = doorIsWireless; + this.siteId = siteId; + this.siteName = siteName; + this.ianaTimezone = ianaTimezone; + this.predefinedTimeSlots = predefinedTimeSlots; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("door_id") + public double getDoorId() { + return doorId; + } + + @JsonProperty("door_name") + public String getDoorName() { + return doorName; + } + + @JsonProperty("device_id") + public Optional getDeviceId() { + return deviceId; + } + + @JsonProperty("door_is_wireless") + public boolean getDoorIsWireless() { + return doorIsWireless; + } + + @JsonProperty("site_id") + public double getSiteId() { + return siteId; + } + + @JsonProperty("site_name") + public String getSiteName() { + return siteName; + } + + @JsonProperty("iana_timezone") + public Optional getIanaTimezone() { + return ianaTimezone; + } + + @JsonProperty("predefined_time_slots") + public Optional> getPredefinedTimeSlots() { + return predefinedTimeSlots; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesDormakabaOracodeMetadata + && equalTo((DevicePropertiesDormakabaOracodeMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesDormakabaOracodeMetadata other) { + return doorId == other.doorId + && doorName.equals(other.doorName) + && deviceId.equals(other.deviceId) + && doorIsWireless == other.doorIsWireless + && siteId == other.siteId + && siteName.equals(other.siteName) + && ianaTimezone.equals(other.ianaTimezone) + && predefinedTimeSlots.equals(other.predefinedTimeSlots); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.doorId, + this.doorName, + this.deviceId, + this.doorIsWireless, + this.siteId, + this.siteName, + this.ianaTimezone, + this.predefinedTimeSlots); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DoorIdStage builder() { + return new Builder(); + } + + public interface DoorIdStage { + DoorNameStage doorId(double doorId); + + Builder from(DevicePropertiesDormakabaOracodeMetadata other); + } + + public interface DoorNameStage { + DoorIsWirelessStage doorName(String doorName); + } + + public interface DoorIsWirelessStage { + SiteIdStage doorIsWireless(boolean doorIsWireless); + } + + public interface SiteIdStage { + SiteNameStage siteId(double siteId); + } + + public interface SiteNameStage { + _FinalStage siteName(String siteName); + } + + public interface _FinalStage { + DevicePropertiesDormakabaOracodeMetadata build(); + + _FinalStage deviceId(Optional deviceId); + + _FinalStage deviceId(Double deviceId); + + _FinalStage ianaTimezone(Optional ianaTimezone); + + _FinalStage ianaTimezone(String ianaTimezone); + + _FinalStage predefinedTimeSlots( + Optional> predefinedTimeSlots); + + _FinalStage predefinedTimeSlots( + List predefinedTimeSlots); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DoorIdStage, DoorNameStage, DoorIsWirelessStage, SiteIdStage, SiteNameStage, _FinalStage { + private double doorId; + + private String doorName; + + private boolean doorIsWireless; + + private double siteId; + + private String siteName; + + private Optional> predefinedTimeSlots = + Optional.empty(); + + private Optional ianaTimezone = Optional.empty(); + + private Optional deviceId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesDormakabaOracodeMetadata other) { + doorId(other.getDoorId()); + doorName(other.getDoorName()); + deviceId(other.getDeviceId()); + doorIsWireless(other.getDoorIsWireless()); + siteId(other.getSiteId()); + siteName(other.getSiteName()); + ianaTimezone(other.getIanaTimezone()); + predefinedTimeSlots(other.getPredefinedTimeSlots()); + return this; + } + + @java.lang.Override + @JsonSetter("door_id") + public DoorNameStage doorId(double doorId) { + this.doorId = doorId; + return this; + } + + @java.lang.Override + @JsonSetter("door_name") + public DoorIsWirelessStage doorName(String doorName) { + this.doorName = doorName; + return this; + } + + @java.lang.Override + @JsonSetter("door_is_wireless") + public SiteIdStage doorIsWireless(boolean doorIsWireless) { + this.doorIsWireless = doorIsWireless; + return this; + } + + @java.lang.Override + @JsonSetter("site_id") + public SiteNameStage siteId(double siteId) { + this.siteId = siteId; + return this; + } + + @java.lang.Override + @JsonSetter("site_name") + public _FinalStage siteName(String siteName) { + this.siteName = siteName; + return this; + } + + @java.lang.Override + public _FinalStage predefinedTimeSlots( + List predefinedTimeSlots) { + this.predefinedTimeSlots = Optional.of(predefinedTimeSlots); + return this; + } + + @java.lang.Override + @JsonSetter(value = "predefined_time_slots", nulls = Nulls.SKIP) + public _FinalStage predefinedTimeSlots( + Optional> predefinedTimeSlots) { + this.predefinedTimeSlots = predefinedTimeSlots; + return this; + } + + @java.lang.Override + public _FinalStage ianaTimezone(String ianaTimezone) { + this.ianaTimezone = Optional.of(ianaTimezone); + return this; + } + + @java.lang.Override + @JsonSetter(value = "iana_timezone", nulls = Nulls.SKIP) + public _FinalStage ianaTimezone(Optional ianaTimezone) { + this.ianaTimezone = ianaTimezone; + return this; + } + + @java.lang.Override + public _FinalStage deviceId(Double deviceId) { + this.deviceId = Optional.of(deviceId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "device_id", nulls = Nulls.SKIP) + public _FinalStage deviceId(Optional deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public DevicePropertiesDormakabaOracodeMetadata build() { + return new DevicePropertiesDormakabaOracodeMetadata( + doorId, + doorName, + deviceId, + doorIsWireless, + siteId, + siteName, + ianaTimezone, + predefinedTimeSlots, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem.java b/src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem.java new file mode 100644 index 0000000..b7e703d --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem.Builder.class) +public final class DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem { + private final String name; + + private final double prefix; + + private final String checkInTime; + + private final String checkOutTime; + + private final boolean is24Hour; + + private final boolean isBiweeklyMode; + + private final boolean isOneShot; + + private final boolean isMaster; + + private final double extDormakabaOracodeUserLevelPrefix; + + private final String dormakabaOracodeUserLevelId; + + private final Map additionalProperties; + + private DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem( + String name, + double prefix, + String checkInTime, + String checkOutTime, + boolean is24Hour, + boolean isBiweeklyMode, + boolean isOneShot, + boolean isMaster, + double extDormakabaOracodeUserLevelPrefix, + String dormakabaOracodeUserLevelId, + Map additionalProperties) { + this.name = name; + this.prefix = prefix; + this.checkInTime = checkInTime; + this.checkOutTime = checkOutTime; + this.is24Hour = is24Hour; + this.isBiweeklyMode = isBiweeklyMode; + this.isOneShot = isOneShot; + this.isMaster = isMaster; + this.extDormakabaOracodeUserLevelPrefix = extDormakabaOracodeUserLevelPrefix; + this.dormakabaOracodeUserLevelId = dormakabaOracodeUserLevelId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("prefix") + public double getPrefix() { + return prefix; + } + + @JsonProperty("check_in_time") + public String getCheckInTime() { + return checkInTime; + } + + @JsonProperty("check_out_time") + public String getCheckOutTime() { + return checkOutTime; + } + + @JsonProperty("is_24_hour") + public boolean getIs24Hour() { + return is24Hour; + } + + @JsonProperty("is_biweekly_mode") + public boolean getIsBiweeklyMode() { + return isBiweeklyMode; + } + + @JsonProperty("is_one_shot") + public boolean getIsOneShot() { + return isOneShot; + } + + @JsonProperty("is_master") + public boolean getIsMaster() { + return isMaster; + } + + @JsonProperty("ext_dormakaba_oracode_user_level_prefix") + public double getExtDormakabaOracodeUserLevelPrefix() { + return extDormakabaOracodeUserLevelPrefix; + } + + @JsonProperty("dormakaba_oracode_user_level_id") + public String getDormakabaOracodeUserLevelId() { + return dormakabaOracodeUserLevelId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem + && equalTo((DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem other) { + return name.equals(other.name) + && prefix == other.prefix + && checkInTime.equals(other.checkInTime) + && checkOutTime.equals(other.checkOutTime) + && is24Hour == other.is24Hour + && isBiweeklyMode == other.isBiweeklyMode + && isOneShot == other.isOneShot + && isMaster == other.isMaster + && extDormakabaOracodeUserLevelPrefix == other.extDormakabaOracodeUserLevelPrefix + && dormakabaOracodeUserLevelId.equals(other.dormakabaOracodeUserLevelId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.prefix, + this.checkInTime, + this.checkOutTime, + this.is24Hour, + this.isBiweeklyMode, + this.isOneShot, + this.isMaster, + this.extDormakabaOracodeUserLevelPrefix, + this.dormakabaOracodeUserLevelId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + PrefixStage name(String name); + + Builder from(DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem other); + } + + public interface PrefixStage { + CheckInTimeStage prefix(double prefix); + } + + public interface CheckInTimeStage { + CheckOutTimeStage checkInTime(String checkInTime); + } + + public interface CheckOutTimeStage { + Is24HourStage checkOutTime(String checkOutTime); + } + + public interface Is24HourStage { + IsBiweeklyModeStage is24Hour(boolean is24Hour); + } + + public interface IsBiweeklyModeStage { + IsOneShotStage isBiweeklyMode(boolean isBiweeklyMode); + } + + public interface IsOneShotStage { + IsMasterStage isOneShot(boolean isOneShot); + } + + public interface IsMasterStage { + ExtDormakabaOracodeUserLevelPrefixStage isMaster(boolean isMaster); + } + + public interface ExtDormakabaOracodeUserLevelPrefixStage { + DormakabaOracodeUserLevelIdStage extDormakabaOracodeUserLevelPrefix(double extDormakabaOracodeUserLevelPrefix); + } + + public interface DormakabaOracodeUserLevelIdStage { + _FinalStage dormakabaOracodeUserLevelId(String dormakabaOracodeUserLevelId); + } + + public interface _FinalStage { + DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, + PrefixStage, + CheckInTimeStage, + CheckOutTimeStage, + Is24HourStage, + IsBiweeklyModeStage, + IsOneShotStage, + IsMasterStage, + ExtDormakabaOracodeUserLevelPrefixStage, + DormakabaOracodeUserLevelIdStage, + _FinalStage { + private String name; + + private double prefix; + + private String checkInTime; + + private String checkOutTime; + + private boolean is24Hour; + + private boolean isBiweeklyMode; + + private boolean isOneShot; + + private boolean isMaster; + + private double extDormakabaOracodeUserLevelPrefix; + + private String dormakabaOracodeUserLevelId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem other) { + name(other.getName()); + prefix(other.getPrefix()); + checkInTime(other.getCheckInTime()); + checkOutTime(other.getCheckOutTime()); + is24Hour(other.getIs24Hour()); + isBiweeklyMode(other.getIsBiweeklyMode()); + isOneShot(other.getIsOneShot()); + isMaster(other.getIsMaster()); + extDormakabaOracodeUserLevelPrefix(other.getExtDormakabaOracodeUserLevelPrefix()); + dormakabaOracodeUserLevelId(other.getDormakabaOracodeUserLevelId()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public PrefixStage name(String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("prefix") + public CheckInTimeStage prefix(double prefix) { + this.prefix = prefix; + return this; + } + + @java.lang.Override + @JsonSetter("check_in_time") + public CheckOutTimeStage checkInTime(String checkInTime) { + this.checkInTime = checkInTime; + return this; + } + + @java.lang.Override + @JsonSetter("check_out_time") + public Is24HourStage checkOutTime(String checkOutTime) { + this.checkOutTime = checkOutTime; + return this; + } + + @java.lang.Override + @JsonSetter("is_24_hour") + public IsBiweeklyModeStage is24Hour(boolean is24Hour) { + this.is24Hour = is24Hour; + return this; + } + + @java.lang.Override + @JsonSetter("is_biweekly_mode") + public IsOneShotStage isBiweeklyMode(boolean isBiweeklyMode) { + this.isBiweeklyMode = isBiweeklyMode; + return this; + } + + @java.lang.Override + @JsonSetter("is_one_shot") + public IsMasterStage isOneShot(boolean isOneShot) { + this.isOneShot = isOneShot; + return this; + } + + @java.lang.Override + @JsonSetter("is_master") + public ExtDormakabaOracodeUserLevelPrefixStage isMaster(boolean isMaster) { + this.isMaster = isMaster; + return this; + } + + @java.lang.Override + @JsonSetter("ext_dormakaba_oracode_user_level_prefix") + public DormakabaOracodeUserLevelIdStage extDormakabaOracodeUserLevelPrefix( + double extDormakabaOracodeUserLevelPrefix) { + this.extDormakabaOracodeUserLevelPrefix = extDormakabaOracodeUserLevelPrefix; + return this; + } + + @java.lang.Override + @JsonSetter("dormakaba_oracode_user_level_id") + public _FinalStage dormakabaOracodeUserLevelId(String dormakabaOracodeUserLevelId) { + this.dormakabaOracodeUserLevelId = dormakabaOracodeUserLevelId; + return this; + } + + @java.lang.Override + public DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem build() { + return new DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlotsItem( + name, + prefix, + checkInTime, + checkOutTime, + is24Hour, + isBiweeklyMode, + isOneShot, + isMaster, + extDormakabaOracodeUserLevelPrefix, + dormakabaOracodeUserLevelId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesEcobeeMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesEcobeeMetadata.java new file mode 100644 index 0000000..136dba2 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesEcobeeMetadata.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesEcobeeMetadata.Builder.class) +public final class DevicePropertiesEcobeeMetadata { + private final String ecobeeDeviceId; + + private final String deviceName; + + private final Map additionalProperties; + + private DevicePropertiesEcobeeMetadata( + String ecobeeDeviceId, String deviceName, Map additionalProperties) { + this.ecobeeDeviceId = ecobeeDeviceId; + this.deviceName = deviceName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("ecobee_device_id") + public String getEcobeeDeviceId() { + return ecobeeDeviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesEcobeeMetadata && equalTo((DevicePropertiesEcobeeMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesEcobeeMetadata other) { + return ecobeeDeviceId.equals(other.ecobeeDeviceId) && deviceName.equals(other.deviceName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.ecobeeDeviceId, this.deviceName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EcobeeDeviceIdStage builder() { + return new Builder(); + } + + public interface EcobeeDeviceIdStage { + DeviceNameStage ecobeeDeviceId(String ecobeeDeviceId); + + Builder from(DevicePropertiesEcobeeMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesEcobeeMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EcobeeDeviceIdStage, DeviceNameStage, _FinalStage { + private String ecobeeDeviceId; + + private String deviceName; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesEcobeeMetadata other) { + ecobeeDeviceId(other.getEcobeeDeviceId()); + deviceName(other.getDeviceName()); + return this; + } + + @java.lang.Override + @JsonSetter("ecobee_device_id") + public DeviceNameStage ecobeeDeviceId(String ecobeeDeviceId) { + this.ecobeeDeviceId = ecobeeDeviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public DevicePropertiesEcobeeMetadata build() { + return new DevicePropertiesEcobeeMetadata(ecobeeDeviceId, deviceName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesFourSuitesMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesFourSuitesMetadata.java new file mode 100644 index 0000000..819de7c --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesFourSuitesMetadata.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesFourSuitesMetadata.Builder.class) +public final class DevicePropertiesFourSuitesMetadata { + private final double deviceId; + + private final String deviceName; + + private final double recloseDelayInSeconds; + + private final Map additionalProperties; + + private DevicePropertiesFourSuitesMetadata( + double deviceId, + String deviceName, + double recloseDelayInSeconds, + Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.recloseDelayInSeconds = recloseDelayInSeconds; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public double getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("reclose_delay_in_seconds") + public double getRecloseDelayInSeconds() { + return recloseDelayInSeconds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesFourSuitesMetadata + && equalTo((DevicePropertiesFourSuitesMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesFourSuitesMetadata other) { + return deviceId == other.deviceId + && deviceName.equals(other.deviceName) + && recloseDelayInSeconds == other.recloseDelayInSeconds; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.recloseDelayInSeconds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(double deviceId); + + Builder from(DevicePropertiesFourSuitesMetadata other); + } + + public interface DeviceNameStage { + RecloseDelayInSecondsStage deviceName(String deviceName); + } + + public interface RecloseDelayInSecondsStage { + _FinalStage recloseDelayInSeconds(double recloseDelayInSeconds); + } + + public interface _FinalStage { + DevicePropertiesFourSuitesMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DeviceIdStage, DeviceNameStage, RecloseDelayInSecondsStage, _FinalStage { + private double deviceId; + + private String deviceName; + + private double recloseDelayInSeconds; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesFourSuitesMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + recloseDelayInSeconds(other.getRecloseDelayInSeconds()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(double deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public RecloseDelayInSecondsStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("reclose_delay_in_seconds") + public _FinalStage recloseDelayInSeconds(double recloseDelayInSeconds) { + this.recloseDelayInSeconds = recloseDelayInSeconds; + return this; + } + + @java.lang.Override + public DevicePropertiesFourSuitesMetadata build() { + return new DevicePropertiesFourSuitesMetadata( + deviceId, deviceName, recloseDelayInSeconds, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesGenieMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesGenieMetadata.java new file mode 100644 index 0000000..7324e2c --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesGenieMetadata.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesGenieMetadata.Builder.class) +public final class DevicePropertiesGenieMetadata { + private final String deviceName; + + private final String doorName; + + private final Map additionalProperties; + + private DevicePropertiesGenieMetadata( + String deviceName, String doorName, Map additionalProperties) { + this.deviceName = deviceName; + this.doorName = doorName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("door_name") + public String getDoorName() { + return doorName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesGenieMetadata && equalTo((DevicePropertiesGenieMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesGenieMetadata other) { + return deviceName.equals(other.deviceName) && doorName.equals(other.doorName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceName, this.doorName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceNameStage builder() { + return new Builder(); + } + + public interface DeviceNameStage { + DoorNameStage deviceName(String deviceName); + + Builder from(DevicePropertiesGenieMetadata other); + } + + public interface DoorNameStage { + _FinalStage doorName(String doorName); + } + + public interface _FinalStage { + DevicePropertiesGenieMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceNameStage, DoorNameStage, _FinalStage { + private String deviceName; + + private String doorName; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesGenieMetadata other) { + deviceName(other.getDeviceName()); + doorName(other.getDoorName()); + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public DoorNameStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("door_name") + public _FinalStage doorName(String doorName) { + this.doorName = doorName; + return this; + } + + @java.lang.Override + public DevicePropertiesGenieMetadata build() { + return new DevicePropertiesGenieMetadata(deviceName, doorName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesHoneywellResideoMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesHoneywellResideoMetadata.java new file mode 100644 index 0000000..21e9b2f --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesHoneywellResideoMetadata.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesHoneywellResideoMetadata.Builder.class) +public final class DevicePropertiesHoneywellResideoMetadata { + private final String honeywellResideoDeviceId; + + private final String deviceName; + + private final Map additionalProperties; + + private DevicePropertiesHoneywellResideoMetadata( + String honeywellResideoDeviceId, String deviceName, Map additionalProperties) { + this.honeywellResideoDeviceId = honeywellResideoDeviceId; + this.deviceName = deviceName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("honeywell_resideo_device_id") + public String getHoneywellResideoDeviceId() { + return honeywellResideoDeviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesHoneywellResideoMetadata + && equalTo((DevicePropertiesHoneywellResideoMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesHoneywellResideoMetadata other) { + return honeywellResideoDeviceId.equals(other.honeywellResideoDeviceId) && deviceName.equals(other.deviceName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.honeywellResideoDeviceId, this.deviceName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HoneywellResideoDeviceIdStage builder() { + return new Builder(); + } + + public interface HoneywellResideoDeviceIdStage { + DeviceNameStage honeywellResideoDeviceId(String honeywellResideoDeviceId); + + Builder from(DevicePropertiesHoneywellResideoMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesHoneywellResideoMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HoneywellResideoDeviceIdStage, DeviceNameStage, _FinalStage { + private String honeywellResideoDeviceId; + + private String deviceName; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesHoneywellResideoMetadata other) { + honeywellResideoDeviceId(other.getHoneywellResideoDeviceId()); + deviceName(other.getDeviceName()); + return this; + } + + @java.lang.Override + @JsonSetter("honeywell_resideo_device_id") + public DeviceNameStage honeywellResideoDeviceId(String honeywellResideoDeviceId) { + this.honeywellResideoDeviceId = honeywellResideoDeviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public DevicePropertiesHoneywellResideoMetadata build() { + return new DevicePropertiesHoneywellResideoMetadata( + honeywellResideoDeviceId, deviceName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesHubitatMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesHubitatMetadata.java new file mode 100644 index 0000000..2fcee2d --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesHubitatMetadata.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesHubitatMetadata.Builder.class) +public final class DevicePropertiesHubitatMetadata { + private final String deviceId; + + private final String deviceName; + + private final String deviceLabel; + + private final Map additionalProperties; + + private DevicePropertiesHubitatMetadata( + String deviceId, String deviceName, String deviceLabel, Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.deviceLabel = deviceLabel; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("device_label") + public String getDeviceLabel() { + return deviceLabel; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesHubitatMetadata && equalTo((DevicePropertiesHubitatMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesHubitatMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && deviceLabel.equals(other.deviceLabel); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.deviceLabel); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesHubitatMetadata other); + } + + public interface DeviceNameStage { + DeviceLabelStage deviceName(String deviceName); + } + + public interface DeviceLabelStage { + _FinalStage deviceLabel(String deviceLabel); + } + + public interface _FinalStage { + DevicePropertiesHubitatMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, DeviceLabelStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private String deviceLabel; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesHubitatMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + deviceLabel(other.getDeviceLabel()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public DeviceLabelStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("device_label") + public _FinalStage deviceLabel(String deviceLabel) { + this.deviceLabel = deviceLabel; + return this; + } + + @java.lang.Override + public DevicePropertiesHubitatMetadata build() { + return new DevicePropertiesHubitatMetadata(deviceId, deviceName, deviceLabel, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesIglooMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesIglooMetadata.java new file mode 100644 index 0000000..215b709 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesIglooMetadata.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesIglooMetadata.Builder.class) +public final class DevicePropertiesIglooMetadata { + private final String deviceId; + + private final String bridgeId; + + private final Optional model; + + private final Map additionalProperties; + + private DevicePropertiesIglooMetadata( + String deviceId, String bridgeId, Optional model, Map additionalProperties) { + this.deviceId = deviceId; + this.bridgeId = bridgeId; + this.model = model; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("bridge_id") + public String getBridgeId() { + return bridgeId; + } + + @JsonProperty("model") + public Optional getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesIglooMetadata && equalTo((DevicePropertiesIglooMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesIglooMetadata other) { + return deviceId.equals(other.deviceId) && bridgeId.equals(other.bridgeId) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.bridgeId, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + BridgeIdStage deviceId(String deviceId); + + Builder from(DevicePropertiesIglooMetadata other); + } + + public interface BridgeIdStage { + _FinalStage bridgeId(String bridgeId); + } + + public interface _FinalStage { + DevicePropertiesIglooMetadata build(); + + _FinalStage model(Optional model); + + _FinalStage model(String model); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, BridgeIdStage, _FinalStage { + private String deviceId; + + private String bridgeId; + + private Optional model = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesIglooMetadata other) { + deviceId(other.getDeviceId()); + bridgeId(other.getBridgeId()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public BridgeIdStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("bridge_id") + public _FinalStage bridgeId(String bridgeId) { + this.bridgeId = bridgeId; + return this; + } + + @java.lang.Override + public _FinalStage model(String model) { + this.model = Optional.of(model); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model", nulls = Nulls.SKIP) + public _FinalStage model(Optional model) { + this.model = model; + return this; + } + + @java.lang.Override + public DevicePropertiesIglooMetadata build() { + return new DevicePropertiesIglooMetadata(deviceId, bridgeId, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesIgloohomeMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesIgloohomeMetadata.java new file mode 100644 index 0000000..8964f0b --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesIgloohomeMetadata.java @@ -0,0 +1,220 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesIgloohomeMetadata.Builder.class) +public final class DevicePropertiesIgloohomeMetadata { + private final String deviceId; + + private final String deviceName; + + private final Optional bridgeId; + + private final Optional bridgeName; + + private final Optional keypadId; + + private final Map additionalProperties; + + private DevicePropertiesIgloohomeMetadata( + String deviceId, + String deviceName, + Optional bridgeId, + Optional bridgeName, + Optional keypadId, + Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.bridgeId = bridgeId; + this.bridgeName = bridgeName; + this.keypadId = keypadId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("bridge_id") + public Optional getBridgeId() { + return bridgeId; + } + + @JsonProperty("bridge_name") + public Optional getBridgeName() { + return bridgeName; + } + + @JsonProperty("keypad_id") + public Optional getKeypadId() { + return keypadId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesIgloohomeMetadata && equalTo((DevicePropertiesIgloohomeMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesIgloohomeMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && bridgeId.equals(other.bridgeId) + && bridgeName.equals(other.bridgeName) + && keypadId.equals(other.keypadId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.bridgeId, this.bridgeName, this.keypadId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesIgloohomeMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesIgloohomeMetadata build(); + + _FinalStage bridgeId(Optional bridgeId); + + _FinalStage bridgeId(String bridgeId); + + _FinalStage bridgeName(Optional bridgeName); + + _FinalStage bridgeName(String bridgeName); + + _FinalStage keypadId(Optional keypadId); + + _FinalStage keypadId(String keypadId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private Optional keypadId = Optional.empty(); + + private Optional bridgeName = Optional.empty(); + + private Optional bridgeId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesIgloohomeMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + bridgeId(other.getBridgeId()); + bridgeName(other.getBridgeName()); + keypadId(other.getKeypadId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public _FinalStage keypadId(String keypadId) { + this.keypadId = Optional.of(keypadId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "keypad_id", nulls = Nulls.SKIP) + public _FinalStage keypadId(Optional keypadId) { + this.keypadId = keypadId; + return this; + } + + @java.lang.Override + public _FinalStage bridgeName(String bridgeName) { + this.bridgeName = Optional.of(bridgeName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "bridge_name", nulls = Nulls.SKIP) + public _FinalStage bridgeName(Optional bridgeName) { + this.bridgeName = bridgeName; + return this; + } + + @java.lang.Override + public _FinalStage bridgeId(String bridgeId) { + this.bridgeId = Optional.of(bridgeId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "bridge_id", nulls = Nulls.SKIP) + public _FinalStage bridgeId(Optional bridgeId) { + this.bridgeId = bridgeId; + return this; + } + + @java.lang.Override + public DevicePropertiesIgloohomeMetadata build() { + return new DevicePropertiesIgloohomeMetadata( + deviceId, deviceName, bridgeId, bridgeName, keypadId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesKeypadBattery.java b/src/main/java/com/seam/api/types/DevicePropertiesKeypadBattery.java new file mode 100644 index 0000000..48f3005 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesKeypadBattery.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesKeypadBattery.Builder.class) +public final class DevicePropertiesKeypadBattery { + private final double level; + + private final Map additionalProperties; + + private DevicePropertiesKeypadBattery(double level, Map additionalProperties) { + this.level = level; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("level") + public double getLevel() { + return level; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesKeypadBattery && equalTo((DevicePropertiesKeypadBattery) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesKeypadBattery other) { + return level == other.level; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.level); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LevelStage builder() { + return new Builder(); + } + + public interface LevelStage { + _FinalStage level(double level); + + Builder from(DevicePropertiesKeypadBattery other); + } + + public interface _FinalStage { + DevicePropertiesKeypadBattery build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LevelStage, _FinalStage { + private double level; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesKeypadBattery other) { + level(other.getLevel()); + return this; + } + + @java.lang.Override + @JsonSetter("level") + public _FinalStage level(double level) { + this.level = level; + return this; + } + + @java.lang.Override + public DevicePropertiesKeypadBattery build() { + return new DevicePropertiesKeypadBattery(level, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesKwiksetMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesKwiksetMetadata.java new file mode 100644 index 0000000..c1aaf28 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesKwiksetMetadata.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesKwiksetMetadata.Builder.class) +public final class DevicePropertiesKwiksetMetadata { + private final String deviceId; + + private final String deviceName; + + private final String modelNumber; + + private final Map additionalProperties; + + private DevicePropertiesKwiksetMetadata( + String deviceId, String deviceName, String modelNumber, Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.modelNumber = modelNumber; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("model_number") + public String getModelNumber() { + return modelNumber; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesKwiksetMetadata && equalTo((DevicePropertiesKwiksetMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesKwiksetMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && modelNumber.equals(other.modelNumber); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.modelNumber); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesKwiksetMetadata other); + } + + public interface DeviceNameStage { + ModelNumberStage deviceName(String deviceName); + } + + public interface ModelNumberStage { + _FinalStage modelNumber(String modelNumber); + } + + public interface _FinalStage { + DevicePropertiesKwiksetMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, ModelNumberStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private String modelNumber; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesKwiksetMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + modelNumber(other.getModelNumber()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public ModelNumberStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("model_number") + public _FinalStage modelNumber(String modelNumber) { + this.modelNumber = modelNumber; + return this; + } + + @java.lang.Override + public DevicePropertiesKwiksetMetadata build() { + return new DevicePropertiesKwiksetMetadata(deviceId, deviceName, modelNumber, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesLocklyMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesLocklyMetadata.java new file mode 100644 index 0000000..b19c7f3 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesLocklyMetadata.java @@ -0,0 +1,154 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesLocklyMetadata.Builder.class) +public final class DevicePropertiesLocklyMetadata { + private final String deviceId; + + private final String deviceName; + + private final Optional model; + + private final Map additionalProperties; + + private DevicePropertiesLocklyMetadata( + String deviceId, String deviceName, Optional model, Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.model = model; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("model") + public Optional getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesLocklyMetadata && equalTo((DevicePropertiesLocklyMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesLocklyMetadata other) { + return deviceId.equals(other.deviceId) && deviceName.equals(other.deviceName) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesLocklyMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesLocklyMetadata build(); + + _FinalStage model(Optional model); + + _FinalStage model(String model); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private Optional model = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesLocklyMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public _FinalStage model(String model) { + this.model = Optional.of(model); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model", nulls = Nulls.SKIP) + public _FinalStage model(Optional model) { + this.model = model; + return this; + } + + @java.lang.Override + public DevicePropertiesLocklyMetadata build() { + return new DevicePropertiesLocklyMetadata(deviceId, deviceName, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadata.java new file mode 100644 index 0000000..fadeeec --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadata.java @@ -0,0 +1,151 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesMinutMetadata.Builder.class) +public final class DevicePropertiesMinutMetadata { + private final String deviceId; + + private final String deviceName; + + private final DevicePropertiesMinutMetadataLatestSensorValues latestSensorValues; + + private final Map additionalProperties; + + private DevicePropertiesMinutMetadata( + String deviceId, + String deviceName, + DevicePropertiesMinutMetadataLatestSensorValues latestSensorValues, + Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.latestSensorValues = latestSensorValues; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("latest_sensor_values") + public DevicePropertiesMinutMetadataLatestSensorValues getLatestSensorValues() { + return latestSensorValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesMinutMetadata && equalTo((DevicePropertiesMinutMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesMinutMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && latestSensorValues.equals(other.latestSensorValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.latestSensorValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesMinutMetadata other); + } + + public interface DeviceNameStage { + LatestSensorValuesStage deviceName(String deviceName); + } + + public interface LatestSensorValuesStage { + _FinalStage latestSensorValues(DevicePropertiesMinutMetadataLatestSensorValues latestSensorValues); + } + + public interface _FinalStage { + DevicePropertiesMinutMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, LatestSensorValuesStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private DevicePropertiesMinutMetadataLatestSensorValues latestSensorValues; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesMinutMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + latestSensorValues(other.getLatestSensorValues()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public LatestSensorValuesStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("latest_sensor_values") + public _FinalStage latestSensorValues(DevicePropertiesMinutMetadataLatestSensorValues latestSensorValues) { + this.latestSensorValues = latestSensorValues; + return this; + } + + @java.lang.Override + public DevicePropertiesMinutMetadata build() { + return new DevicePropertiesMinutMetadata(deviceId, deviceName, latestSensorValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValues.java b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValues.java new file mode 100644 index 0000000..8f92d2a --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValues.java @@ -0,0 +1,203 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesMinutMetadataLatestSensorValues.Builder.class) +public final class DevicePropertiesMinutMetadataLatestSensorValues { + private final DevicePropertiesMinutMetadataLatestSensorValuesTemperature temperature; + + private final DevicePropertiesMinutMetadataLatestSensorValuesSound sound; + + private final DevicePropertiesMinutMetadataLatestSensorValuesHumidity humidity; + + private final DevicePropertiesMinutMetadataLatestSensorValuesPressure pressure; + + private final DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ accelerometerZ; + + private final Map additionalProperties; + + private DevicePropertiesMinutMetadataLatestSensorValues( + DevicePropertiesMinutMetadataLatestSensorValuesTemperature temperature, + DevicePropertiesMinutMetadataLatestSensorValuesSound sound, + DevicePropertiesMinutMetadataLatestSensorValuesHumidity humidity, + DevicePropertiesMinutMetadataLatestSensorValuesPressure pressure, + DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ accelerometerZ, + Map additionalProperties) { + this.temperature = temperature; + this.sound = sound; + this.humidity = humidity; + this.pressure = pressure; + this.accelerometerZ = accelerometerZ; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("temperature") + public DevicePropertiesMinutMetadataLatestSensorValuesTemperature getTemperature() { + return temperature; + } + + @JsonProperty("sound") + public DevicePropertiesMinutMetadataLatestSensorValuesSound getSound() { + return sound; + } + + @JsonProperty("humidity") + public DevicePropertiesMinutMetadataLatestSensorValuesHumidity getHumidity() { + return humidity; + } + + @JsonProperty("pressure") + public DevicePropertiesMinutMetadataLatestSensorValuesPressure getPressure() { + return pressure; + } + + @JsonProperty("accelerometer_z") + public DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ getAccelerometerZ() { + return accelerometerZ; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesMinutMetadataLatestSensorValues + && equalTo((DevicePropertiesMinutMetadataLatestSensorValues) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesMinutMetadataLatestSensorValues other) { + return temperature.equals(other.temperature) + && sound.equals(other.sound) + && humidity.equals(other.humidity) + && pressure.equals(other.pressure) + && accelerometerZ.equals(other.accelerometerZ); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.temperature, this.sound, this.humidity, this.pressure, this.accelerometerZ); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TemperatureStage builder() { + return new Builder(); + } + + public interface TemperatureStage { + SoundStage temperature(DevicePropertiesMinutMetadataLatestSensorValuesTemperature temperature); + + Builder from(DevicePropertiesMinutMetadataLatestSensorValues other); + } + + public interface SoundStage { + HumidityStage sound(DevicePropertiesMinutMetadataLatestSensorValuesSound sound); + } + + public interface HumidityStage { + PressureStage humidity(DevicePropertiesMinutMetadataLatestSensorValuesHumidity humidity); + } + + public interface PressureStage { + AccelerometerZStage pressure(DevicePropertiesMinutMetadataLatestSensorValuesPressure pressure); + } + + public interface AccelerometerZStage { + _FinalStage accelerometerZ(DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ accelerometerZ); + } + + public interface _FinalStage { + DevicePropertiesMinutMetadataLatestSensorValues build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TemperatureStage, SoundStage, HumidityStage, PressureStage, AccelerometerZStage, _FinalStage { + private DevicePropertiesMinutMetadataLatestSensorValuesTemperature temperature; + + private DevicePropertiesMinutMetadataLatestSensorValuesSound sound; + + private DevicePropertiesMinutMetadataLatestSensorValuesHumidity humidity; + + private DevicePropertiesMinutMetadataLatestSensorValuesPressure pressure; + + private DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ accelerometerZ; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesMinutMetadataLatestSensorValues other) { + temperature(other.getTemperature()); + sound(other.getSound()); + humidity(other.getHumidity()); + pressure(other.getPressure()); + accelerometerZ(other.getAccelerometerZ()); + return this; + } + + @java.lang.Override + @JsonSetter("temperature") + public SoundStage temperature(DevicePropertiesMinutMetadataLatestSensorValuesTemperature temperature) { + this.temperature = temperature; + return this; + } + + @java.lang.Override + @JsonSetter("sound") + public HumidityStage sound(DevicePropertiesMinutMetadataLatestSensorValuesSound sound) { + this.sound = sound; + return this; + } + + @java.lang.Override + @JsonSetter("humidity") + public PressureStage humidity(DevicePropertiesMinutMetadataLatestSensorValuesHumidity humidity) { + this.humidity = humidity; + return this; + } + + @java.lang.Override + @JsonSetter("pressure") + public AccelerometerZStage pressure(DevicePropertiesMinutMetadataLatestSensorValuesPressure pressure) { + this.pressure = pressure; + return this; + } + + @java.lang.Override + @JsonSetter("accelerometer_z") + public _FinalStage accelerometerZ( + DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ accelerometerZ) { + this.accelerometerZ = accelerometerZ; + return this; + } + + @java.lang.Override + public DevicePropertiesMinutMetadataLatestSensorValues build() { + return new DevicePropertiesMinutMetadataLatestSensorValues( + temperature, sound, humidity, pressure, accelerometerZ, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ.java b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ.java new file mode 100644 index 0000000..3b5d877 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ.Builder.class) +public final class DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ { + private final String time; + + private final double value; + + private final Map additionalProperties; + + private DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ( + String time, double value, Map additionalProperties) { + this.time = time; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("time") + public String getTime() { + return time; + } + + @JsonProperty("value") + public double getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ + && equalTo((DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ other) { + return time.equals(other.time) && value == other.value; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.time, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TimeStage builder() { + return new Builder(); + } + + public interface TimeStage { + ValueStage time(String time); + + Builder from(DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ other); + } + + public interface ValueStage { + _FinalStage value(double value); + } + + public interface _FinalStage { + DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TimeStage, ValueStage, _FinalStage { + private String time; + + private double value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ other) { + time(other.getTime()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("time") + public ValueStage time(String time) { + this.time = time; + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(double value) { + this.value = value; + return this; + } + + @java.lang.Override + public DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ build() { + return new DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ(time, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesHumidity.java b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesHumidity.java new file mode 100644 index 0000000..785c87e --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesHumidity.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesMinutMetadataLatestSensorValuesHumidity.Builder.class) +public final class DevicePropertiesMinutMetadataLatestSensorValuesHumidity { + private final String time; + + private final double value; + + private final Map additionalProperties; + + private DevicePropertiesMinutMetadataLatestSensorValuesHumidity( + String time, double value, Map additionalProperties) { + this.time = time; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("time") + public String getTime() { + return time; + } + + @JsonProperty("value") + public double getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesMinutMetadataLatestSensorValuesHumidity + && equalTo((DevicePropertiesMinutMetadataLatestSensorValuesHumidity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesMinutMetadataLatestSensorValuesHumidity other) { + return time.equals(other.time) && value == other.value; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.time, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TimeStage builder() { + return new Builder(); + } + + public interface TimeStage { + ValueStage time(String time); + + Builder from(DevicePropertiesMinutMetadataLatestSensorValuesHumidity other); + } + + public interface ValueStage { + _FinalStage value(double value); + } + + public interface _FinalStage { + DevicePropertiesMinutMetadataLatestSensorValuesHumidity build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TimeStage, ValueStage, _FinalStage { + private String time; + + private double value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesMinutMetadataLatestSensorValuesHumidity other) { + time(other.getTime()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("time") + public ValueStage time(String time) { + this.time = time; + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(double value) { + this.value = value; + return this; + } + + @java.lang.Override + public DevicePropertiesMinutMetadataLatestSensorValuesHumidity build() { + return new DevicePropertiesMinutMetadataLatestSensorValuesHumidity(time, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesPressure.java b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesPressure.java new file mode 100644 index 0000000..93b1336 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesPressure.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesMinutMetadataLatestSensorValuesPressure.Builder.class) +public final class DevicePropertiesMinutMetadataLatestSensorValuesPressure { + private final String time; + + private final double value; + + private final Map additionalProperties; + + private DevicePropertiesMinutMetadataLatestSensorValuesPressure( + String time, double value, Map additionalProperties) { + this.time = time; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("time") + public String getTime() { + return time; + } + + @JsonProperty("value") + public double getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesMinutMetadataLatestSensorValuesPressure + && equalTo((DevicePropertiesMinutMetadataLatestSensorValuesPressure) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesMinutMetadataLatestSensorValuesPressure other) { + return time.equals(other.time) && value == other.value; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.time, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TimeStage builder() { + return new Builder(); + } + + public interface TimeStage { + ValueStage time(String time); + + Builder from(DevicePropertiesMinutMetadataLatestSensorValuesPressure other); + } + + public interface ValueStage { + _FinalStage value(double value); + } + + public interface _FinalStage { + DevicePropertiesMinutMetadataLatestSensorValuesPressure build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TimeStage, ValueStage, _FinalStage { + private String time; + + private double value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesMinutMetadataLatestSensorValuesPressure other) { + time(other.getTime()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("time") + public ValueStage time(String time) { + this.time = time; + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(double value) { + this.value = value; + return this; + } + + @java.lang.Override + public DevicePropertiesMinutMetadataLatestSensorValuesPressure build() { + return new DevicePropertiesMinutMetadataLatestSensorValuesPressure(time, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesSound.java b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesSound.java new file mode 100644 index 0000000..7a465eb --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesSound.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesMinutMetadataLatestSensorValuesSound.Builder.class) +public final class DevicePropertiesMinutMetadataLatestSensorValuesSound { + private final String time; + + private final double value; + + private final Map additionalProperties; + + private DevicePropertiesMinutMetadataLatestSensorValuesSound( + String time, double value, Map additionalProperties) { + this.time = time; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("time") + public String getTime() { + return time; + } + + @JsonProperty("value") + public double getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesMinutMetadataLatestSensorValuesSound + && equalTo((DevicePropertiesMinutMetadataLatestSensorValuesSound) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesMinutMetadataLatestSensorValuesSound other) { + return time.equals(other.time) && value == other.value; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.time, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TimeStage builder() { + return new Builder(); + } + + public interface TimeStage { + ValueStage time(String time); + + Builder from(DevicePropertiesMinutMetadataLatestSensorValuesSound other); + } + + public interface ValueStage { + _FinalStage value(double value); + } + + public interface _FinalStage { + DevicePropertiesMinutMetadataLatestSensorValuesSound build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TimeStage, ValueStage, _FinalStage { + private String time; + + private double value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesMinutMetadataLatestSensorValuesSound other) { + time(other.getTime()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("time") + public ValueStage time(String time) { + this.time = time; + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(double value) { + this.value = value; + return this; + } + + @java.lang.Override + public DevicePropertiesMinutMetadataLatestSensorValuesSound build() { + return new DevicePropertiesMinutMetadataLatestSensorValuesSound(time, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesTemperature.java b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesTemperature.java new file mode 100644 index 0000000..8cf17df --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesMinutMetadataLatestSensorValuesTemperature.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesMinutMetadataLatestSensorValuesTemperature.Builder.class) +public final class DevicePropertiesMinutMetadataLatestSensorValuesTemperature { + private final String time; + + private final double value; + + private final Map additionalProperties; + + private DevicePropertiesMinutMetadataLatestSensorValuesTemperature( + String time, double value, Map additionalProperties) { + this.time = time; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("time") + public String getTime() { + return time; + } + + @JsonProperty("value") + public double getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesMinutMetadataLatestSensorValuesTemperature + && equalTo((DevicePropertiesMinutMetadataLatestSensorValuesTemperature) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesMinutMetadataLatestSensorValuesTemperature other) { + return time.equals(other.time) && value == other.value; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.time, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TimeStage builder() { + return new Builder(); + } + + public interface TimeStage { + ValueStage time(String time); + + Builder from(DevicePropertiesMinutMetadataLatestSensorValuesTemperature other); + } + + public interface ValueStage { + _FinalStage value(double value); + } + + public interface _FinalStage { + DevicePropertiesMinutMetadataLatestSensorValuesTemperature build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TimeStage, ValueStage, _FinalStage { + private String time; + + private double value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesMinutMetadataLatestSensorValuesTemperature other) { + time(other.getTime()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("time") + public ValueStage time(String time) { + this.time = time; + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(double value) { + this.value = value; + return this; + } + + @java.lang.Override + public DevicePropertiesMinutMetadataLatestSensorValuesTemperature build() { + return new DevicePropertiesMinutMetadataLatestSensorValuesTemperature(time, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesModel.java b/src/main/java/com/seam/api/types/DevicePropertiesModel.java index 1cec8ec..4d13303 100644 --- a/src/main/java/com/seam/api/types/DevicePropertiesModel.java +++ b/src/main/java/com/seam/api/types/DevicePropertiesModel.java @@ -9,30 +9,106 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = DevicePropertiesModel.Builder.class) public final class DevicePropertiesModel { + private final Optional canConnectAccessoryKeypad; + private final String displayName; + private final String manufacturerDisplayName; + + private final Optional hasBuiltInKeypad; + + private final Optional offlineAccessCodesSupported; + + private final Optional onlineAccessCodesSupported; + + private final Optional accessoryKeypadSupported; + private final Map additionalProperties; - private DevicePropertiesModel(String displayName, Map additionalProperties) { + private DevicePropertiesModel( + Optional canConnectAccessoryKeypad, + String displayName, + String manufacturerDisplayName, + Optional hasBuiltInKeypad, + Optional offlineAccessCodesSupported, + Optional onlineAccessCodesSupported, + Optional accessoryKeypadSupported, + Map additionalProperties) { + this.canConnectAccessoryKeypad = canConnectAccessoryKeypad; this.displayName = displayName; + this.manufacturerDisplayName = manufacturerDisplayName; + this.hasBuiltInKeypad = hasBuiltInKeypad; + this.offlineAccessCodesSupported = offlineAccessCodesSupported; + this.onlineAccessCodesSupported = onlineAccessCodesSupported; + this.accessoryKeypadSupported = accessoryKeypadSupported; this.additionalProperties = additionalProperties; } + /** + * @return Indicates whether the device can connect a accessory keypad. + */ + @JsonProperty("can_connect_accessory_keypad") + public Optional getCanConnectAccessoryKeypad() { + return canConnectAccessoryKeypad; + } + + /** + * @return Display name of the device model. + */ @JsonProperty("display_name") public String getDisplayName() { return displayName; } - @Override + /** + * @return Display name that corresponds to the manufacturer-specific terminology for the device. + */ + @JsonProperty("manufacturer_display_name") + public String getManufacturerDisplayName() { + return manufacturerDisplayName; + } + + /** + * @return Indicates whether the device has a built in accessory keypad. + */ + @JsonProperty("has_built_in_keypad") + public Optional getHasBuiltInKeypad() { + return hasBuiltInKeypad; + } + + /** + * @return Indicates whether the device supports offline access codes. + */ + @JsonProperty("offline_access_codes_supported") + public Optional getOfflineAccessCodesSupported() { + return offlineAccessCodesSupported; + } + + /** + * @return Indicates whether the device supports online access codes. + */ + @JsonProperty("online_access_codes_supported") + public Optional getOnlineAccessCodesSupported() { + return onlineAccessCodesSupported; + } + + @JsonProperty("accessory_keypad_supported") + public Optional getAccessoryKeypadSupported() { + return accessoryKeypadSupported; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DevicePropertiesModel && equalTo((DevicePropertiesModel) other); @@ -44,15 +120,28 @@ public Map getAdditionalProperties() { } private boolean equalTo(DevicePropertiesModel other) { - return displayName.equals(other.displayName); + return canConnectAccessoryKeypad.equals(other.canConnectAccessoryKeypad) + && displayName.equals(other.displayName) + && manufacturerDisplayName.equals(other.manufacturerDisplayName) + && hasBuiltInKeypad.equals(other.hasBuiltInKeypad) + && offlineAccessCodesSupported.equals(other.offlineAccessCodesSupported) + && onlineAccessCodesSupported.equals(other.onlineAccessCodesSupported) + && accessoryKeypadSupported.equals(other.accessoryKeypadSupported); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.displayName); + return Objects.hash( + this.canConnectAccessoryKeypad, + this.displayName, + this.manufacturerDisplayName, + this.hasBuiltInKeypad, + this.offlineAccessCodesSupported, + this.onlineAccessCodesSupported, + this.accessoryKeypadSupported); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -62,40 +151,186 @@ public static DisplayNameStage builder() { } public interface DisplayNameStage { - _FinalStage displayName(String displayName); + ManufacturerDisplayNameStage displayName(String displayName); Builder from(DevicePropertiesModel other); } + public interface ManufacturerDisplayNameStage { + _FinalStage manufacturerDisplayName(String manufacturerDisplayName); + } + public interface _FinalStage { DevicePropertiesModel build(); + + _FinalStage canConnectAccessoryKeypad(Optional canConnectAccessoryKeypad); + + _FinalStage canConnectAccessoryKeypad(Boolean canConnectAccessoryKeypad); + + _FinalStage hasBuiltInKeypad(Optional hasBuiltInKeypad); + + _FinalStage hasBuiltInKeypad(Boolean hasBuiltInKeypad); + + _FinalStage offlineAccessCodesSupported(Optional offlineAccessCodesSupported); + + _FinalStage offlineAccessCodesSupported(Boolean offlineAccessCodesSupported); + + _FinalStage onlineAccessCodesSupported(Optional onlineAccessCodesSupported); + + _FinalStage onlineAccessCodesSupported(Boolean onlineAccessCodesSupported); + + _FinalStage accessoryKeypadSupported(Optional accessoryKeypadSupported); + + _FinalStage accessoryKeypadSupported(Boolean accessoryKeypadSupported); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DisplayNameStage, _FinalStage { + public static final class Builder implements DisplayNameStage, ManufacturerDisplayNameStage, _FinalStage { private String displayName; + private String manufacturerDisplayName; + + private Optional accessoryKeypadSupported = Optional.empty(); + + private Optional onlineAccessCodesSupported = Optional.empty(); + + private Optional offlineAccessCodesSupported = Optional.empty(); + + private Optional hasBuiltInKeypad = Optional.empty(); + + private Optional canConnectAccessoryKeypad = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(DevicePropertiesModel other) { + canConnectAccessoryKeypad(other.getCanConnectAccessoryKeypad()); displayName(other.getDisplayName()); + manufacturerDisplayName(other.getManufacturerDisplayName()); + hasBuiltInKeypad(other.getHasBuiltInKeypad()); + offlineAccessCodesSupported(other.getOfflineAccessCodesSupported()); + onlineAccessCodesSupported(other.getOnlineAccessCodesSupported()); + accessoryKeypadSupported(other.getAccessoryKeypadSupported()); return this; } - @Override + /** + *

Display name of the device model.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("display_name") - public _FinalStage displayName(String displayName) { + public ManufacturerDisplayNameStage displayName(String displayName) { this.displayName = displayName; return this; } - @Override + /** + *

Display name that corresponds to the manufacturer-specific terminology for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("manufacturer_display_name") + public _FinalStage manufacturerDisplayName(String manufacturerDisplayName) { + this.manufacturerDisplayName = manufacturerDisplayName; + return this; + } + + @java.lang.Override + public _FinalStage accessoryKeypadSupported(Boolean accessoryKeypadSupported) { + this.accessoryKeypadSupported = Optional.of(accessoryKeypadSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "accessory_keypad_supported", nulls = Nulls.SKIP) + public _FinalStage accessoryKeypadSupported(Optional accessoryKeypadSupported) { + this.accessoryKeypadSupported = accessoryKeypadSupported; + return this; + } + + /** + *

Indicates whether the device supports online access codes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage onlineAccessCodesSupported(Boolean onlineAccessCodesSupported) { + this.onlineAccessCodesSupported = Optional.of(onlineAccessCodesSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "online_access_codes_supported", nulls = Nulls.SKIP) + public _FinalStage onlineAccessCodesSupported(Optional onlineAccessCodesSupported) { + this.onlineAccessCodesSupported = onlineAccessCodesSupported; + return this; + } + + /** + *

Indicates whether the device supports offline access codes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage offlineAccessCodesSupported(Boolean offlineAccessCodesSupported) { + this.offlineAccessCodesSupported = Optional.of(offlineAccessCodesSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "offline_access_codes_supported", nulls = Nulls.SKIP) + public _FinalStage offlineAccessCodesSupported(Optional offlineAccessCodesSupported) { + this.offlineAccessCodesSupported = offlineAccessCodesSupported; + return this; + } + + /** + *

Indicates whether the device has a built in accessory keypad.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hasBuiltInKeypad(Boolean hasBuiltInKeypad) { + this.hasBuiltInKeypad = Optional.of(hasBuiltInKeypad); + return this; + } + + @java.lang.Override + @JsonSetter(value = "has_built_in_keypad", nulls = Nulls.SKIP) + public _FinalStage hasBuiltInKeypad(Optional hasBuiltInKeypad) { + this.hasBuiltInKeypad = hasBuiltInKeypad; + return this; + } + + /** + *

Indicates whether the device can connect a accessory keypad.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage canConnectAccessoryKeypad(Boolean canConnectAccessoryKeypad) { + this.canConnectAccessoryKeypad = Optional.of(canConnectAccessoryKeypad); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_connect_accessory_keypad", nulls = Nulls.SKIP) + public _FinalStage canConnectAccessoryKeypad(Optional canConnectAccessoryKeypad) { + this.canConnectAccessoryKeypad = canConnectAccessoryKeypad; + return this; + } + + @java.lang.Override public DevicePropertiesModel build() { - return new DevicePropertiesModel(displayName, additionalProperties); + return new DevicePropertiesModel( + canConnectAccessoryKeypad, + displayName, + manufacturerDisplayName, + hasBuiltInKeypad, + offlineAccessCodesSupported, + onlineAccessCodesSupported, + accessoryKeypadSupported, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/DevicePropertiesNestMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesNestMetadata.java new file mode 100644 index 0000000..bfd53ad --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesNestMetadata.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesNestMetadata.Builder.class) +public final class DevicePropertiesNestMetadata { + private final String nestDeviceId; + + private final String deviceName; + + private final String customName; + + private final Map additionalProperties; + + private DevicePropertiesNestMetadata( + String nestDeviceId, String deviceName, String customName, Map additionalProperties) { + this.nestDeviceId = nestDeviceId; + this.deviceName = deviceName; + this.customName = customName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("nest_device_id") + public String getNestDeviceId() { + return nestDeviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("custom_name") + public String getCustomName() { + return customName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesNestMetadata && equalTo((DevicePropertiesNestMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesNestMetadata other) { + return nestDeviceId.equals(other.nestDeviceId) + && deviceName.equals(other.deviceName) + && customName.equals(other.customName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.nestDeviceId, this.deviceName, this.customName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NestDeviceIdStage builder() { + return new Builder(); + } + + public interface NestDeviceIdStage { + DeviceNameStage nestDeviceId(String nestDeviceId); + + Builder from(DevicePropertiesNestMetadata other); + } + + public interface DeviceNameStage { + CustomNameStage deviceName(String deviceName); + } + + public interface CustomNameStage { + _FinalStage customName(String customName); + } + + public interface _FinalStage { + DevicePropertiesNestMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NestDeviceIdStage, DeviceNameStage, CustomNameStage, _FinalStage { + private String nestDeviceId; + + private String deviceName; + + private String customName; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesNestMetadata other) { + nestDeviceId(other.getNestDeviceId()); + deviceName(other.getDeviceName()); + customName(other.getCustomName()); + return this; + } + + @java.lang.Override + @JsonSetter("nest_device_id") + public DeviceNameStage nestDeviceId(String nestDeviceId) { + this.nestDeviceId = nestDeviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public CustomNameStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("custom_name") + public _FinalStage customName(String customName) { + this.customName = customName; + return this; + } + + @java.lang.Override + public DevicePropertiesNestMetadata build() { + return new DevicePropertiesNestMetadata(nestDeviceId, deviceName, customName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadata.java new file mode 100644 index 0000000..fdf7726 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadata.java @@ -0,0 +1,208 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesNoiseawareMetadata.Builder.class) +public final class DevicePropertiesNoiseawareMetadata { + private final DevicePropertiesNoiseawareMetadataDeviceModel deviceModel; + + private final double noiseLevelNrs; + + private final double noiseLevelDecibel; + + private final String deviceName; + + private final String deviceId; + + private final Map additionalProperties; + + private DevicePropertiesNoiseawareMetadata( + DevicePropertiesNoiseawareMetadataDeviceModel deviceModel, + double noiseLevelNrs, + double noiseLevelDecibel, + String deviceName, + String deviceId, + Map additionalProperties) { + this.deviceModel = deviceModel; + this.noiseLevelNrs = noiseLevelNrs; + this.noiseLevelDecibel = noiseLevelDecibel; + this.deviceName = deviceName; + this.deviceId = deviceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_model") + public DevicePropertiesNoiseawareMetadataDeviceModel getDeviceModel() { + return deviceModel; + } + + @JsonProperty("noise_level_nrs") + public double getNoiseLevelNrs() { + return noiseLevelNrs; + } + + @JsonProperty("noise_level_decibel") + public double getNoiseLevelDecibel() { + return noiseLevelDecibel; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesNoiseawareMetadata + && equalTo((DevicePropertiesNoiseawareMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesNoiseawareMetadata other) { + return deviceModel.equals(other.deviceModel) + && noiseLevelNrs == other.noiseLevelNrs + && noiseLevelDecibel == other.noiseLevelDecibel + && deviceName.equals(other.deviceName) + && deviceId.equals(other.deviceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.deviceModel, this.noiseLevelNrs, this.noiseLevelDecibel, this.deviceName, this.deviceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceModelStage builder() { + return new Builder(); + } + + public interface DeviceModelStage { + NoiseLevelNrsStage deviceModel(DevicePropertiesNoiseawareMetadataDeviceModel deviceModel); + + Builder from(DevicePropertiesNoiseawareMetadata other); + } + + public interface NoiseLevelNrsStage { + NoiseLevelDecibelStage noiseLevelNrs(double noiseLevelNrs); + } + + public interface NoiseLevelDecibelStage { + DeviceNameStage noiseLevelDecibel(double noiseLevelDecibel); + } + + public interface DeviceNameStage { + DeviceIdStage deviceName(String deviceName); + } + + public interface DeviceIdStage { + _FinalStage deviceId(String deviceId); + } + + public interface _FinalStage { + DevicePropertiesNoiseawareMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DeviceModelStage, + NoiseLevelNrsStage, + NoiseLevelDecibelStage, + DeviceNameStage, + DeviceIdStage, + _FinalStage { + private DevicePropertiesNoiseawareMetadataDeviceModel deviceModel; + + private double noiseLevelNrs; + + private double noiseLevelDecibel; + + private String deviceName; + + private String deviceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesNoiseawareMetadata other) { + deviceModel(other.getDeviceModel()); + noiseLevelNrs(other.getNoiseLevelNrs()); + noiseLevelDecibel(other.getNoiseLevelDecibel()); + deviceName(other.getDeviceName()); + deviceId(other.getDeviceId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_model") + public NoiseLevelNrsStage deviceModel(DevicePropertiesNoiseawareMetadataDeviceModel deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + @java.lang.Override + @JsonSetter("noise_level_nrs") + public NoiseLevelDecibelStage noiseLevelNrs(double noiseLevelNrs) { + this.noiseLevelNrs = noiseLevelNrs; + return this; + } + + @java.lang.Override + @JsonSetter("noise_level_decibel") + public DeviceNameStage noiseLevelDecibel(double noiseLevelDecibel) { + this.noiseLevelDecibel = noiseLevelDecibel; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public DeviceIdStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public _FinalStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + public DevicePropertiesNoiseawareMetadata build() { + return new DevicePropertiesNoiseawareMetadata( + deviceModel, noiseLevelNrs, noiseLevelDecibel, deviceName, deviceId, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadataDeviceModel.java b/src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadataDeviceModel.java new file mode 100644 index 0000000..f7b6503 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesNoiseawareMetadataDeviceModel.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DevicePropertiesNoiseawareMetadataDeviceModel { + INDOOR("indoor"), + + OUTDOOR("outdoor"); + + private final String value; + + DevicePropertiesNoiseawareMetadataDeviceModel(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesNukiMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesNukiMetadata.java new file mode 100644 index 0000000..e9bdba7 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesNukiMetadata.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesNukiMetadata.Builder.class) +public final class DevicePropertiesNukiMetadata { + private final String deviceId; + + private final String deviceName; + + private final Optional keypadBatteryCritical; + + private final Optional keypadPaired; + + private final Optional keypad2Paired; + + private final Map additionalProperties; + + private DevicePropertiesNukiMetadata( + String deviceId, + String deviceName, + Optional keypadBatteryCritical, + Optional keypadPaired, + Optional keypad2Paired, + Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.keypadBatteryCritical = keypadBatteryCritical; + this.keypadPaired = keypadPaired; + this.keypad2Paired = keypad2Paired; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("keypad_battery_critical") + public Optional getKeypadBatteryCritical() { + return keypadBatteryCritical; + } + + @JsonProperty("keypad_paired") + public Optional getKeypadPaired() { + return keypadPaired; + } + + @JsonProperty("keypad_2_paired") + public Optional getKeypad2Paired() { + return keypad2Paired; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesNukiMetadata && equalTo((DevicePropertiesNukiMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesNukiMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && keypadBatteryCritical.equals(other.keypadBatteryCritical) + && keypadPaired.equals(other.keypadPaired) + && keypad2Paired.equals(other.keypad2Paired); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.deviceId, this.deviceName, this.keypadBatteryCritical, this.keypadPaired, this.keypad2Paired); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesNukiMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesNukiMetadata build(); + + _FinalStage keypadBatteryCritical(Optional keypadBatteryCritical); + + _FinalStage keypadBatteryCritical(Boolean keypadBatteryCritical); + + _FinalStage keypadPaired(Optional keypadPaired); + + _FinalStage keypadPaired(Boolean keypadPaired); + + _FinalStage keypad2Paired(Optional keypad2Paired); + + _FinalStage keypad2Paired(Boolean keypad2Paired); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private Optional keypad2Paired = Optional.empty(); + + private Optional keypadPaired = Optional.empty(); + + private Optional keypadBatteryCritical = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesNukiMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + keypadBatteryCritical(other.getKeypadBatteryCritical()); + keypadPaired(other.getKeypadPaired()); + keypad2Paired(other.getKeypad2Paired()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public _FinalStage keypad2Paired(Boolean keypad2Paired) { + this.keypad2Paired = Optional.of(keypad2Paired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "keypad_2_paired", nulls = Nulls.SKIP) + public _FinalStage keypad2Paired(Optional keypad2Paired) { + this.keypad2Paired = keypad2Paired; + return this; + } + + @java.lang.Override + public _FinalStage keypadPaired(Boolean keypadPaired) { + this.keypadPaired = Optional.of(keypadPaired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "keypad_paired", nulls = Nulls.SKIP) + public _FinalStage keypadPaired(Optional keypadPaired) { + this.keypadPaired = keypadPaired; + return this; + } + + @java.lang.Override + public _FinalStage keypadBatteryCritical(Boolean keypadBatteryCritical) { + this.keypadBatteryCritical = Optional.of(keypadBatteryCritical); + return this; + } + + @java.lang.Override + @JsonSetter(value = "keypad_battery_critical", nulls = Nulls.SKIP) + public _FinalStage keypadBatteryCritical(Optional keypadBatteryCritical) { + this.keypadBatteryCritical = keypadBatteryCritical; + return this; + } + + @java.lang.Override + public DevicePropertiesNukiMetadata build() { + return new DevicePropertiesNukiMetadata( + deviceId, deviceName, keypadBatteryCritical, keypadPaired, keypad2Paired, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesSaltoMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesSaltoMetadata.java new file mode 100644 index 0000000..5fac424 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesSaltoMetadata.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesSaltoMetadata.Builder.class) +public final class DevicePropertiesSaltoMetadata { + private final String lockId; + + private final String customerReference; + + private final String lockType; + + private final String batteryLevel; + + private final String lockedState; + + private final Optional model; + + private final Map additionalProperties; + + private DevicePropertiesSaltoMetadata( + String lockId, + String customerReference, + String lockType, + String batteryLevel, + String lockedState, + Optional model, + Map additionalProperties) { + this.lockId = lockId; + this.customerReference = customerReference; + this.lockType = lockType; + this.batteryLevel = batteryLevel; + this.lockedState = lockedState; + this.model = model; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("lock_id") + public String getLockId() { + return lockId; + } + + @JsonProperty("customer_reference") + public String getCustomerReference() { + return customerReference; + } + + @JsonProperty("lock_type") + public String getLockType() { + return lockType; + } + + @JsonProperty("battery_level") + public String getBatteryLevel() { + return batteryLevel; + } + + @JsonProperty("locked_state") + public String getLockedState() { + return lockedState; + } + + @JsonProperty("model") + public Optional getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesSaltoMetadata && equalTo((DevicePropertiesSaltoMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesSaltoMetadata other) { + return lockId.equals(other.lockId) + && customerReference.equals(other.customerReference) + && lockType.equals(other.lockType) + && batteryLevel.equals(other.batteryLevel) + && lockedState.equals(other.lockedState) + && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.lockId, this.customerReference, this.lockType, this.batteryLevel, this.lockedState, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LockIdStage builder() { + return new Builder(); + } + + public interface LockIdStage { + CustomerReferenceStage lockId(String lockId); + + Builder from(DevicePropertiesSaltoMetadata other); + } + + public interface CustomerReferenceStage { + LockTypeStage customerReference(String customerReference); + } + + public interface LockTypeStage { + BatteryLevelStage lockType(String lockType); + } + + public interface BatteryLevelStage { + LockedStateStage batteryLevel(String batteryLevel); + } + + public interface LockedStateStage { + _FinalStage lockedState(String lockedState); + } + + public interface _FinalStage { + DevicePropertiesSaltoMetadata build(); + + _FinalStage model(Optional model); + + _FinalStage model(String model); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements LockIdStage, + CustomerReferenceStage, + LockTypeStage, + BatteryLevelStage, + LockedStateStage, + _FinalStage { + private String lockId; + + private String customerReference; + + private String lockType; + + private String batteryLevel; + + private String lockedState; + + private Optional model = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesSaltoMetadata other) { + lockId(other.getLockId()); + customerReference(other.getCustomerReference()); + lockType(other.getLockType()); + batteryLevel(other.getBatteryLevel()); + lockedState(other.getLockedState()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("lock_id") + public CustomerReferenceStage lockId(String lockId) { + this.lockId = lockId; + return this; + } + + @java.lang.Override + @JsonSetter("customer_reference") + public LockTypeStage customerReference(String customerReference) { + this.customerReference = customerReference; + return this; + } + + @java.lang.Override + @JsonSetter("lock_type") + public BatteryLevelStage lockType(String lockType) { + this.lockType = lockType; + return this; + } + + @java.lang.Override + @JsonSetter("battery_level") + public LockedStateStage batteryLevel(String batteryLevel) { + this.batteryLevel = batteryLevel; + return this; + } + + @java.lang.Override + @JsonSetter("locked_state") + public _FinalStage lockedState(String lockedState) { + this.lockedState = lockedState; + return this; + } + + @java.lang.Override + public _FinalStage model(String model) { + this.model = Optional.of(model); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model", nulls = Nulls.SKIP) + public _FinalStage model(Optional model) { + this.model = model; + return this; + } + + @java.lang.Override + public DevicePropertiesSaltoMetadata build() { + return new DevicePropertiesSaltoMetadata( + lockId, customerReference, lockType, batteryLevel, lockedState, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesSchlageMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesSchlageMetadata.java new file mode 100644 index 0000000..d5fea81 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesSchlageMetadata.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesSchlageMetadata.Builder.class) +public final class DevicePropertiesSchlageMetadata { + private final String deviceId; + + private final String deviceName; + + private final Optional accessCodeLength; + + private final Optional model; + + private final Map additionalProperties; + + private DevicePropertiesSchlageMetadata( + String deviceId, + String deviceName, + Optional accessCodeLength, + Optional model, + Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.accessCodeLength = accessCodeLength; + this.model = model; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("access_code_length") + public Optional getAccessCodeLength() { + return accessCodeLength; + } + + @JsonProperty("model") + public Optional getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesSchlageMetadata && equalTo((DevicePropertiesSchlageMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesSchlageMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && accessCodeLength.equals(other.accessCodeLength) + && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName, this.accessCodeLength, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesSchlageMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesSchlageMetadata build(); + + _FinalStage accessCodeLength(Optional accessCodeLength); + + _FinalStage accessCodeLength(Double accessCodeLength); + + _FinalStage model(Optional model); + + _FinalStage model(String model); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, _FinalStage { + private String deviceId; + + private String deviceName; + + private Optional model = Optional.empty(); + + private Optional accessCodeLength = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesSchlageMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + accessCodeLength(other.getAccessCodeLength()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public _FinalStage model(String model) { + this.model = Optional.of(model); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model", nulls = Nulls.SKIP) + public _FinalStage model(Optional model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage accessCodeLength(Double accessCodeLength) { + this.accessCodeLength = Optional.of(accessCodeLength); + return this; + } + + @java.lang.Override + @JsonSetter(value = "access_code_length", nulls = Nulls.SKIP) + public _FinalStage accessCodeLength(Optional accessCodeLength) { + this.accessCodeLength = accessCodeLength; + return this; + } + + @java.lang.Override + public DevicePropertiesSchlageMetadata build() { + return new DevicePropertiesSchlageMetadata( + deviceId, deviceName, accessCodeLength, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadata.java new file mode 100644 index 0000000..51120fb --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadata.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesSeamBridgeMetadata.Builder.class) +public final class DevicePropertiesSeamBridgeMetadata { + private final Optional unlockMethod; + + private final double deviceNum; + + private final String name; + + private final Map additionalProperties; + + private DevicePropertiesSeamBridgeMetadata( + Optional unlockMethod, + double deviceNum, + String name, + Map additionalProperties) { + this.unlockMethod = unlockMethod; + this.deviceNum = deviceNum; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("unlock_method") + public Optional getUnlockMethod() { + return unlockMethod; + } + + @JsonProperty("device_num") + public double getDeviceNum() { + return deviceNum; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesSeamBridgeMetadata + && equalTo((DevicePropertiesSeamBridgeMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesSeamBridgeMetadata other) { + return unlockMethod.equals(other.unlockMethod) && deviceNum == other.deviceNum && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.unlockMethod, this.deviceNum, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceNumStage builder() { + return new Builder(); + } + + public interface DeviceNumStage { + NameStage deviceNum(double deviceNum); + + Builder from(DevicePropertiesSeamBridgeMetadata other); + } + + public interface NameStage { + _FinalStage name(String name); + } + + public interface _FinalStage { + DevicePropertiesSeamBridgeMetadata build(); + + _FinalStage unlockMethod(Optional unlockMethod); + + _FinalStage unlockMethod(DevicePropertiesSeamBridgeMetadataUnlockMethod unlockMethod); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceNumStage, NameStage, _FinalStage { + private double deviceNum; + + private String name; + + private Optional unlockMethod = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesSeamBridgeMetadata other) { + unlockMethod(other.getUnlockMethod()); + deviceNum(other.getDeviceNum()); + name(other.getName()); + return this; + } + + @java.lang.Override + @JsonSetter("device_num") + public NameStage deviceNum(double deviceNum) { + this.deviceNum = deviceNum; + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(String name) { + this.name = name; + return this; + } + + @java.lang.Override + public _FinalStage unlockMethod(DevicePropertiesSeamBridgeMetadataUnlockMethod unlockMethod) { + this.unlockMethod = Optional.of(unlockMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "unlock_method", nulls = Nulls.SKIP) + public _FinalStage unlockMethod(Optional unlockMethod) { + this.unlockMethod = unlockMethod; + return this; + } + + @java.lang.Override + public DevicePropertiesSeamBridgeMetadata build() { + return new DevicePropertiesSeamBridgeMetadata(unlockMethod, deviceNum, name, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadataUnlockMethod.java b/src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadataUnlockMethod.java new file mode 100644 index 0000000..97c721c --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesSeamBridgeMetadataUnlockMethod.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DevicePropertiesSeamBridgeMetadataUnlockMethod { + BRIDGE("bridge"), + + DOORKING("doorking"); + + private final String value; + + DevicePropertiesSeamBridgeMetadataUnlockMethod(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/SchlageDeviceMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesSmartthingsMetadata.java similarity index 71% rename from src/main/java/com/seam/api/types/SchlageDeviceMetadata.java rename to src/main/java/com/seam/api/types/DevicePropertiesSmartthingsMetadata.java index 3033d09..6775e05 100644 --- a/src/main/java/com/seam/api/types/SchlageDeviceMetadata.java +++ b/src/main/java/com/seam/api/types/DevicePropertiesSmartthingsMetadata.java @@ -18,30 +18,26 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = SchlageDeviceMetadata.Builder.class) -public final class SchlageDeviceMetadata { +@JsonDeserialize(builder = DevicePropertiesSmartthingsMetadata.Builder.class) +public final class DevicePropertiesSmartthingsMetadata { private final String deviceId; private final String deviceName; - private final int accessCodeLength; - private final Optional model; private final Optional locationId; private final Map additionalProperties; - private SchlageDeviceMetadata( + private DevicePropertiesSmartthingsMetadata( String deviceId, String deviceName, - int accessCodeLength, Optional model, Optional locationId, Map additionalProperties) { this.deviceId = deviceId; this.deviceName = deviceName; - this.accessCodeLength = accessCodeLength; this.model = model; this.locationId = locationId; this.additionalProperties = additionalProperties; @@ -57,11 +53,6 @@ public String getDeviceName() { return deviceName; } - @JsonProperty("access_code_length") - public int getAccessCodeLength() { - return accessCodeLength; - } - @JsonProperty("model") public Optional getModel() { return model; @@ -72,10 +63,11 @@ public Optional getLocationId() { return locationId; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchlageDeviceMetadata && equalTo((SchlageDeviceMetadata) other); + return other instanceof DevicePropertiesSmartthingsMetadata + && equalTo((DevicePropertiesSmartthingsMetadata) other); } @JsonAnyGetter @@ -83,20 +75,19 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(SchlageDeviceMetadata other) { + private boolean equalTo(DevicePropertiesSmartthingsMetadata other) { return deviceId.equals(other.deviceId) && deviceName.equals(other.deviceName) - && accessCodeLength == other.accessCodeLength && model.equals(other.model) && locationId.equals(other.locationId); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.deviceId, this.deviceName, this.accessCodeLength, this.model, this.locationId); + return Objects.hash(this.deviceId, this.deviceName, this.model, this.locationId); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -108,19 +99,15 @@ public static DeviceIdStage builder() { public interface DeviceIdStage { DeviceNameStage deviceId(String deviceId); - Builder from(SchlageDeviceMetadata other); + Builder from(DevicePropertiesSmartthingsMetadata other); } public interface DeviceNameStage { - AccessCodeLengthStage deviceName(String deviceName); - } - - public interface AccessCodeLengthStage { - _FinalStage accessCodeLength(int accessCodeLength); + _FinalStage deviceName(String deviceName); } public interface _FinalStage { - SchlageDeviceMetadata build(); + DevicePropertiesSmartthingsMetadata build(); _FinalStage model(Optional model); @@ -132,13 +119,11 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DeviceIdStage, DeviceNameStage, AccessCodeLengthStage, _FinalStage { + public static final class Builder implements DeviceIdStage, DeviceNameStage, _FinalStage { private String deviceId; private String deviceName; - private int accessCodeLength; - private Optional locationId = Optional.empty(); private Optional model = Optional.empty(); @@ -148,67 +133,59 @@ public static final class Builder implements DeviceIdStage, DeviceNameStage, Acc private Builder() {} - @Override - public Builder from(SchlageDeviceMetadata other) { + @java.lang.Override + public Builder from(DevicePropertiesSmartthingsMetadata other) { deviceId(other.getDeviceId()); deviceName(other.getDeviceName()); - accessCodeLength(other.getAccessCodeLength()); model(other.getModel()); locationId(other.getLocationId()); return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public DeviceNameStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("device_name") - public AccessCodeLengthStage deviceName(String deviceName) { + public _FinalStage deviceName(String deviceName) { this.deviceName = deviceName; return this; } - @Override - @JsonSetter("access_code_length") - public _FinalStage accessCodeLength(int accessCodeLength) { - this.accessCodeLength = accessCodeLength; - return this; - } - - @Override + @java.lang.Override public _FinalStage locationId(String locationId) { this.locationId = Optional.of(locationId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "location_id", nulls = Nulls.SKIP) public _FinalStage locationId(Optional locationId) { this.locationId = locationId; return this; } - @Override + @java.lang.Override public _FinalStage model(String model) { this.model = Optional.of(model); return this; } - @Override + @java.lang.Override @JsonSetter(value = "model", nulls = Nulls.SKIP) public _FinalStage model(Optional model) { this.model = model; return this; } - @Override - public SchlageDeviceMetadata build() { - return new SchlageDeviceMetadata( - deviceId, deviceName, accessCodeLength, model, locationId, additionalProperties); + @java.lang.Override + public DevicePropertiesSmartthingsMetadata build() { + return new DevicePropertiesSmartthingsMetadata( + deviceId, deviceName, model, locationId, additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/DevicePropertiesTedeeMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesTedeeMetadata.java new file mode 100644 index 0000000..70f6856 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesTedeeMetadata.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesTedeeMetadata.Builder.class) +public final class DevicePropertiesTedeeMetadata { + private final double deviceId; + + private final String serialNumber; + + private final String deviceName; + + private final String deviceModel; + + private final double bridgeId; + + private final String bridgeName; + + private final Optional keypadId; + + private final Map additionalProperties; + + private DevicePropertiesTedeeMetadata( + double deviceId, + String serialNumber, + String deviceName, + String deviceModel, + double bridgeId, + String bridgeName, + Optional keypadId, + Map additionalProperties) { + this.deviceId = deviceId; + this.serialNumber = serialNumber; + this.deviceName = deviceName; + this.deviceModel = deviceModel; + this.bridgeId = bridgeId; + this.bridgeName = bridgeName; + this.keypadId = keypadId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public double getDeviceId() { + return deviceId; + } + + @JsonProperty("serial_number") + public String getSerialNumber() { + return serialNumber; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("device_model") + public String getDeviceModel() { + return deviceModel; + } + + @JsonProperty("bridge_id") + public double getBridgeId() { + return bridgeId; + } + + @JsonProperty("bridge_name") + public String getBridgeName() { + return bridgeName; + } + + @JsonProperty("keypad_id") + public Optional getKeypadId() { + return keypadId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesTedeeMetadata && equalTo((DevicePropertiesTedeeMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesTedeeMetadata other) { + return deviceId == other.deviceId + && serialNumber.equals(other.serialNumber) + && deviceName.equals(other.deviceName) + && deviceModel.equals(other.deviceModel) + && bridgeId == other.bridgeId + && bridgeName.equals(other.bridgeName) + && keypadId.equals(other.keypadId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.deviceId, + this.serialNumber, + this.deviceName, + this.deviceModel, + this.bridgeId, + this.bridgeName, + this.keypadId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + SerialNumberStage deviceId(double deviceId); + + Builder from(DevicePropertiesTedeeMetadata other); + } + + public interface SerialNumberStage { + DeviceNameStage serialNumber(String serialNumber); + } + + public interface DeviceNameStage { + DeviceModelStage deviceName(String deviceName); + } + + public interface DeviceModelStage { + BridgeIdStage deviceModel(String deviceModel); + } + + public interface BridgeIdStage { + BridgeNameStage bridgeId(double bridgeId); + } + + public interface BridgeNameStage { + _FinalStage bridgeName(String bridgeName); + } + + public interface _FinalStage { + DevicePropertiesTedeeMetadata build(); + + _FinalStage keypadId(Optional keypadId); + + _FinalStage keypadId(Double keypadId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DeviceIdStage, + SerialNumberStage, + DeviceNameStage, + DeviceModelStage, + BridgeIdStage, + BridgeNameStage, + _FinalStage { + private double deviceId; + + private String serialNumber; + + private String deviceName; + + private String deviceModel; + + private double bridgeId; + + private String bridgeName; + + private Optional keypadId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesTedeeMetadata other) { + deviceId(other.getDeviceId()); + serialNumber(other.getSerialNumber()); + deviceName(other.getDeviceName()); + deviceModel(other.getDeviceModel()); + bridgeId(other.getBridgeId()); + bridgeName(other.getBridgeName()); + keypadId(other.getKeypadId()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public SerialNumberStage deviceId(double deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("serial_number") + public DeviceNameStage serialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public DeviceModelStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("device_model") + public BridgeIdStage deviceModel(String deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + @java.lang.Override + @JsonSetter("bridge_id") + public BridgeNameStage bridgeId(double bridgeId) { + this.bridgeId = bridgeId; + return this; + } + + @java.lang.Override + @JsonSetter("bridge_name") + public _FinalStage bridgeName(String bridgeName) { + this.bridgeName = bridgeName; + return this; + } + + @java.lang.Override + public _FinalStage keypadId(Double keypadId) { + this.keypadId = Optional.of(keypadId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "keypad_id", nulls = Nulls.SKIP) + public _FinalStage keypadId(Optional keypadId) { + this.keypadId = keypadId; + return this; + } + + @java.lang.Override + public DevicePropertiesTedeeMetadata build() { + return new DevicePropertiesTedeeMetadata( + deviceId, + serialNumber, + deviceName, + deviceModel, + bridgeId, + bridgeName, + keypadId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesTtlockMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesTtlockMetadata.java new file mode 100644 index 0000000..ea1a2ae --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesTtlockMetadata.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesTtlockMetadata.Builder.class) +public final class DevicePropertiesTtlockMetadata { + private final double lockId; + + private final String lockAlias; + + private final String featureValue; + + private final Map additionalProperties; + + private DevicePropertiesTtlockMetadata( + double lockId, String lockAlias, String featureValue, Map additionalProperties) { + this.lockId = lockId; + this.lockAlias = lockAlias; + this.featureValue = featureValue; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("lock_id") + public double getLockId() { + return lockId; + } + + @JsonProperty("lock_alias") + public String getLockAlias() { + return lockAlias; + } + + @JsonProperty("feature_value") + public String getFeatureValue() { + return featureValue; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesTtlockMetadata && equalTo((DevicePropertiesTtlockMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesTtlockMetadata other) { + return lockId == other.lockId && lockAlias.equals(other.lockAlias) && featureValue.equals(other.featureValue); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.lockId, this.lockAlias, this.featureValue); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LockIdStage builder() { + return new Builder(); + } + + public interface LockIdStage { + LockAliasStage lockId(double lockId); + + Builder from(DevicePropertiesTtlockMetadata other); + } + + public interface LockAliasStage { + FeatureValueStage lockAlias(String lockAlias); + } + + public interface FeatureValueStage { + _FinalStage featureValue(String featureValue); + } + + public interface _FinalStage { + DevicePropertiesTtlockMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LockIdStage, LockAliasStage, FeatureValueStage, _FinalStage { + private double lockId; + + private String lockAlias; + + private String featureValue; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesTtlockMetadata other) { + lockId(other.getLockId()); + lockAlias(other.getLockAlias()); + featureValue(other.getFeatureValue()); + return this; + } + + @java.lang.Override + @JsonSetter("lock_id") + public LockAliasStage lockId(double lockId) { + this.lockId = lockId; + return this; + } + + @java.lang.Override + @JsonSetter("lock_alias") + public FeatureValueStage lockAlias(String lockAlias) { + this.lockAlias = lockAlias; + return this; + } + + @java.lang.Override + @JsonSetter("feature_value") + public _FinalStage featureValue(String featureValue) { + this.featureValue = featureValue; + return this; + } + + @java.lang.Override + public DevicePropertiesTtlockMetadata build() { + return new DevicePropertiesTtlockMetadata(lockId, lockAlias, featureValue, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesTwoNMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesTwoNMetadata.java new file mode 100644 index 0000000..a2f9147 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesTwoNMetadata.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesTwoNMetadata.Builder.class) +public final class DevicePropertiesTwoNMetadata { + private final double deviceId; + + private final String deviceName; + + private final Map additionalProperties; + + private DevicePropertiesTwoNMetadata(double deviceId, String deviceName, Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public double getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesTwoNMetadata && equalTo((DevicePropertiesTwoNMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesTwoNMetadata other) { + return deviceId == other.deviceId && deviceName.equals(other.deviceName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.deviceId, this.deviceName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(double deviceId); + + Builder from(DevicePropertiesTwoNMetadata other); + } + + public interface DeviceNameStage { + _FinalStage deviceName(String deviceName); + } + + public interface _FinalStage { + DevicePropertiesTwoNMetadata build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DeviceIdStage, DeviceNameStage, _FinalStage { + private double deviceId; + + private String deviceName; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesTwoNMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(double deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public _FinalStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + public DevicePropertiesTwoNMetadata build() { + return new DevicePropertiesTwoNMetadata(deviceId, deviceName, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicePropertiesWyzeMetadata.java b/src/main/java/com/seam/api/types/DevicePropertiesWyzeMetadata.java new file mode 100644 index 0000000..d117bd0 --- /dev/null +++ b/src/main/java/com/seam/api/types/DevicePropertiesWyzeMetadata.java @@ -0,0 +1,309 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = DevicePropertiesWyzeMetadata.Builder.class) +public final class DevicePropertiesWyzeMetadata { + private final String deviceId; + + private final String deviceName; + + private final String productName; + + private final String productType; + + private final String productModel; + + private final String deviceInfoModel; + + private final Optional keypadUuid; + + private final Optional lockerStatusHardlock; + + private final Map additionalProperties; + + private DevicePropertiesWyzeMetadata( + String deviceId, + String deviceName, + String productName, + String productType, + String productModel, + String deviceInfoModel, + Optional keypadUuid, + Optional lockerStatusHardlock, + Map additionalProperties) { + this.deviceId = deviceId; + this.deviceName = deviceName; + this.productName = productName; + this.productType = productType; + this.productModel = productModel; + this.deviceInfoModel = deviceInfoModel; + this.keypadUuid = keypadUuid; + this.lockerStatusHardlock = lockerStatusHardlock; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_name") + public String getDeviceName() { + return deviceName; + } + + @JsonProperty("product_name") + public String getProductName() { + return productName; + } + + @JsonProperty("product_type") + public String getProductType() { + return productType; + } + + @JsonProperty("product_model") + public String getProductModel() { + return productModel; + } + + @JsonProperty("device_info_model") + public String getDeviceInfoModel() { + return deviceInfoModel; + } + + @JsonProperty("keypad_uuid") + public Optional getKeypadUuid() { + return keypadUuid; + } + + @JsonProperty("locker_status_hardlock") + public Optional getLockerStatusHardlock() { + return lockerStatusHardlock; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DevicePropertiesWyzeMetadata && equalTo((DevicePropertiesWyzeMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DevicePropertiesWyzeMetadata other) { + return deviceId.equals(other.deviceId) + && deviceName.equals(other.deviceName) + && productName.equals(other.productName) + && productType.equals(other.productType) + && productModel.equals(other.productModel) + && deviceInfoModel.equals(other.deviceInfoModel) + && keypadUuid.equals(other.keypadUuid) + && lockerStatusHardlock.equals(other.lockerStatusHardlock); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.deviceId, + this.deviceName, + this.productName, + this.productType, + this.productModel, + this.deviceInfoModel, + this.keypadUuid, + this.lockerStatusHardlock); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceNameStage deviceId(String deviceId); + + Builder from(DevicePropertiesWyzeMetadata other); + } + + public interface DeviceNameStage { + ProductNameStage deviceName(String deviceName); + } + + public interface ProductNameStage { + ProductTypeStage productName(String productName); + } + + public interface ProductTypeStage { + ProductModelStage productType(String productType); + } + + public interface ProductModelStage { + DeviceInfoModelStage productModel(String productModel); + } + + public interface DeviceInfoModelStage { + _FinalStage deviceInfoModel(String deviceInfoModel); + } + + public interface _FinalStage { + DevicePropertiesWyzeMetadata build(); + + _FinalStage keypadUuid(Optional keypadUuid); + + _FinalStage keypadUuid(String keypadUuid); + + _FinalStage lockerStatusHardlock(Optional lockerStatusHardlock); + + _FinalStage lockerStatusHardlock(Double lockerStatusHardlock); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DeviceIdStage, + DeviceNameStage, + ProductNameStage, + ProductTypeStage, + ProductModelStage, + DeviceInfoModelStage, + _FinalStage { + private String deviceId; + + private String deviceName; + + private String productName; + + private String productType; + + private String productModel; + + private String deviceInfoModel; + + private Optional lockerStatusHardlock = Optional.empty(); + + private Optional keypadUuid = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DevicePropertiesWyzeMetadata other) { + deviceId(other.getDeviceId()); + deviceName(other.getDeviceName()); + productName(other.getProductName()); + productType(other.getProductType()); + productModel(other.getProductModel()); + deviceInfoModel(other.getDeviceInfoModel()); + keypadUuid(other.getKeypadUuid()); + lockerStatusHardlock(other.getLockerStatusHardlock()); + return this; + } + + @java.lang.Override + @JsonSetter("device_id") + public DeviceNameStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_name") + public ProductNameStage deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + @java.lang.Override + @JsonSetter("product_name") + public ProductTypeStage productName(String productName) { + this.productName = productName; + return this; + } + + @java.lang.Override + @JsonSetter("product_type") + public ProductModelStage productType(String productType) { + this.productType = productType; + return this; + } + + @java.lang.Override + @JsonSetter("product_model") + public DeviceInfoModelStage productModel(String productModel) { + this.productModel = productModel; + return this; + } + + @java.lang.Override + @JsonSetter("device_info_model") + public _FinalStage deviceInfoModel(String deviceInfoModel) { + this.deviceInfoModel = deviceInfoModel; + return this; + } + + @java.lang.Override + public _FinalStage lockerStatusHardlock(Double lockerStatusHardlock) { + this.lockerStatusHardlock = Optional.of(lockerStatusHardlock); + return this; + } + + @java.lang.Override + @JsonSetter(value = "locker_status_hardlock", nulls = Nulls.SKIP) + public _FinalStage lockerStatusHardlock(Optional lockerStatusHardlock) { + this.lockerStatusHardlock = lockerStatusHardlock; + return this; + } + + @java.lang.Override + public _FinalStage keypadUuid(String keypadUuid) { + this.keypadUuid = Optional.of(keypadUuid); + return this; + } + + @java.lang.Override + @JsonSetter(value = "keypad_uuid", nulls = Nulls.SKIP) + public _FinalStage keypadUuid(Optional keypadUuid) { + this.keypadUuid = keypadUuid; + return this; + } + + @java.lang.Override + public DevicePropertiesWyzeMetadata build() { + return new DevicePropertiesWyzeMetadata( + deviceId, + deviceName, + productName, + productType, + productModel, + deviceInfoModel, + keypadUuid, + lockerStatusHardlock, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponseDeviceProvidersItem.java b/src/main/java/com/seam/api/types/DeviceProvider.java similarity index 59% rename from src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponseDeviceProvidersItem.java rename to src/main/java/com/seam/api/types/DeviceProvider.java index c7c71d8..fb2a082 100644 --- a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponseDeviceProvidersItem.java +++ b/src/main/java/com/seam/api/types/DeviceProvider.java @@ -19,23 +19,23 @@ import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = DevicesListDeviceProvidersResponseDeviceProvidersItem.Builder.class) -public final class DevicesListDeviceProvidersResponseDeviceProvidersItem { - private final String deviceProviderName; +@JsonDeserialize(builder = DeviceProvider.Builder.class) +public final class DeviceProvider { + private final DeviceProviderDeviceProviderName deviceProviderName; private final String displayName; private final String imageUrl; - private final List providerCategories; + private final List providerCategories; private final Map additionalProperties; - private DevicesListDeviceProvidersResponseDeviceProvidersItem( - String deviceProviderName, + private DeviceProvider( + DeviceProviderDeviceProviderName deviceProviderName, String displayName, String imageUrl, - List providerCategories, + List providerCategories, Map additionalProperties) { this.deviceProviderName = deviceProviderName; this.displayName = displayName; @@ -45,7 +45,7 @@ private DevicesListDeviceProvidersResponseDeviceProvidersItem( } @JsonProperty("device_provider_name") - public String getDeviceProviderName() { + public DeviceProviderDeviceProviderName getDeviceProviderName() { return deviceProviderName; } @@ -60,15 +60,14 @@ public String getImageUrl() { } @JsonProperty("provider_categories") - public List getProviderCategories() { + public List getProviderCategories() { return providerCategories; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DevicesListDeviceProvidersResponseDeviceProvidersItem - && equalTo((DevicesListDeviceProvidersResponseDeviceProvidersItem) other); + return other instanceof DeviceProvider && equalTo((DeviceProvider) other); } @JsonAnyGetter @@ -76,19 +75,19 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DevicesListDeviceProvidersResponseDeviceProvidersItem other) { + private boolean equalTo(DeviceProvider other) { return deviceProviderName.equals(other.deviceProviderName) && displayName.equals(other.displayName) && imageUrl.equals(other.imageUrl) && providerCategories.equals(other.providerCategories); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.deviceProviderName, this.displayName, this.imageUrl, this.providerCategories); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -98,9 +97,9 @@ public static DeviceProviderNameStage builder() { } public interface DeviceProviderNameStage { - DisplayNameStage deviceProviderName(String deviceProviderName); + DisplayNameStage deviceProviderName(DeviceProviderDeviceProviderName deviceProviderName); - Builder from(DevicesListDeviceProvidersResponseDeviceProvidersItem other); + Builder from(DeviceProvider other); } public interface DisplayNameStage { @@ -112,36 +111,32 @@ public interface ImageUrlStage { } public interface _FinalStage { - DevicesListDeviceProvidersResponseDeviceProvidersItem build(); + DeviceProvider build(); - _FinalStage providerCategories( - List providerCategories); + _FinalStage providerCategories(List providerCategories); - _FinalStage addProviderCategories( - DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem providerCategories); + _FinalStage addProviderCategories(DeviceProviderProviderCategoriesItem providerCategories); - _FinalStage addAllProviderCategories( - List providerCategories); + _FinalStage addAllProviderCategories(List providerCategories); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements DeviceProviderNameStage, DisplayNameStage, ImageUrlStage, _FinalStage { - private String deviceProviderName; + private DeviceProviderDeviceProviderName deviceProviderName; private String displayName; private String imageUrl; - private List providerCategories = - new ArrayList<>(); + private List providerCategories = new ArrayList<>(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override - public Builder from(DevicesListDeviceProvidersResponseDeviceProvidersItem other) { + @java.lang.Override + public Builder from(DeviceProvider other) { deviceProviderName(other.getDeviceProviderName()); displayName(other.getDisplayName()); imageUrl(other.getImageUrl()); @@ -149,53 +144,50 @@ public Builder from(DevicesListDeviceProvidersResponseDeviceProvidersItem other) return this; } - @Override + @java.lang.Override @JsonSetter("device_provider_name") - public DisplayNameStage deviceProviderName(String deviceProviderName) { + public DisplayNameStage deviceProviderName(DeviceProviderDeviceProviderName deviceProviderName) { this.deviceProviderName = deviceProviderName; return this; } - @Override + @java.lang.Override @JsonSetter("display_name") public ImageUrlStage displayName(String displayName) { this.displayName = displayName; return this; } - @Override + @java.lang.Override @JsonSetter("image_url") public _FinalStage imageUrl(String imageUrl) { this.imageUrl = imageUrl; return this; } - @Override - public _FinalStage addAllProviderCategories( - List providerCategories) { + @java.lang.Override + public _FinalStage addAllProviderCategories(List providerCategories) { this.providerCategories.addAll(providerCategories); return this; } - @Override - public _FinalStage addProviderCategories( - DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem providerCategories) { + @java.lang.Override + public _FinalStage addProviderCategories(DeviceProviderProviderCategoriesItem providerCategories) { this.providerCategories.add(providerCategories); return this; } - @Override + @java.lang.Override @JsonSetter(value = "provider_categories", nulls = Nulls.SKIP) - public _FinalStage providerCategories( - List providerCategories) { + public _FinalStage providerCategories(List providerCategories) { this.providerCategories.clear(); this.providerCategories.addAll(providerCategories); return this; } - @Override - public DevicesListDeviceProvidersResponseDeviceProvidersItem build() { - return new DevicesListDeviceProvidersResponseDeviceProvidersItem( + @java.lang.Override + public DeviceProvider build() { + return new DeviceProvider( deviceProviderName, displayName, imageUrl, providerCategories, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/AcceptedProvider.java b/src/main/java/com/seam/api/types/DeviceProviderDeviceProviderName.java similarity index 66% rename from src/main/java/com/seam/api/types/AcceptedProvider.java rename to src/main/java/com/seam/api/types/DeviceProviderDeviceProviderName.java index f8b8acb..3f09d41 100644 --- a/src/main/java/com/seam/api/types/AcceptedProvider.java +++ b/src/main/java/com/seam/api/types/DeviceProviderDeviceProviderName.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum AcceptedProvider { +public enum DeviceProviderDeviceProviderName { AKUVOX("akuvox"), AUGUST("august"), @@ -58,16 +58,36 @@ public enum AcceptedProvider { HUBITAT("hubitat"), - YALE_ACCESS("yale_access"); + FOUR_SUITES("four_suites"), + + DORMAKABA_ORACODE("dormakaba_oracode"), + + PTI("pti"), + + WYZE("wyze"), + + SEAM_PASSPORT("seam_passport"), + + VISIONLINE("visionline"), + + ASSA_ABLOY_CREDENTIAL_SERVICE("assa_abloy_credential_service"), + + SEAM_BRIDGE("seam_bridge"), + + TEDEE("tedee"), + + HONEYWELL_RESIDEO("honeywell_resideo"), + + LATCH("latch"); private final String value; - AcceptedProvider(String value) { + DeviceProviderDeviceProviderName(String value) { this.value = value; } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem.java b/src/main/java/com/seam/api/types/DeviceProviderProviderCategoriesItem.java similarity index 51% rename from src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem.java rename to src/main/java/com/seam/api/types/DeviceProviderProviderCategoriesItem.java index 2e5a5db..82414c3 100644 --- a/src/main/java/com/seam/api/types/DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem.java +++ b/src/main/java/com/seam/api/types/DeviceProviderProviderCategoriesItem.java @@ -5,19 +5,25 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem { +public enum DeviceProviderProviderCategoriesItem { STABLE("stable"), - CONSUMER_SMARTLOCKS("consumer_smartlocks"); + CONSUMER_SMARTLOCKS("consumer_smartlocks"), + + THERMOSTATS("thermostats"), + + NOISE_SENSORS("noise_sensors"), + + ACCESS_CONTROL_SYSTEMS("access_control_systems"); private final String value; - DevicesListDeviceProvidersResponseDeviceProvidersItemProviderCategoriesItem(String value) { + DeviceProviderProviderCategoriesItem(String value) { this.value = value; } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/DeviceType.java b/src/main/java/com/seam/api/types/DeviceType.java index 63183d2..e226ced 100644 --- a/src/main/java/com/seam/api/types/DeviceType.java +++ b/src/main/java/com/seam/api/types/DeviceType.java @@ -14,6 +14,8 @@ public enum DeviceType { BUTTERFLYMX_PANEL("butterflymx_panel"), + AVIGILON_ALTA_ENTRY("avigilon_alta_entry"), + DOORKING_LOCK("doorking_lock"), GENIE_DOOR("genie_door"), @@ -36,6 +38,8 @@ public enum DeviceType { SMARTTHINGS_LOCK("smartthings_lock"), + WYZE_LOCK("wyze_lock"), + YALE_LOCK("yale_lock"), TWO_N_INTERCOM("two_n_intercom"), @@ -48,13 +52,21 @@ public enum DeviceType { HUBITAT_LOCK("hubitat_lock"), + FOUR_SUITES_DOOR("four_suites_door"), + + DORMAKABA_ORACODE_DOOR("dormakaba_oracode_door"), + NOISEAWARE_ACTIVITY_ZONE("noiseaware_activity_zone"), MINUT_SENSOR("minut_sensor"), ECOBEE_THERMOSTAT("ecobee_thermostat"), - NEST_THERMOSTAT("nest_thermostat"); + NEST_THERMOSTAT("nest_thermostat"), + + IOS_PHONE("ios_phone"), + + ANDROID_PHONE("android_phone"); private final String value; @@ -63,7 +75,7 @@ public enum DeviceType { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/DeviceWarningsItem.java b/src/main/java/com/seam/api/types/DeviceWarningsItem.java index f35fc7a..773cef6 100644 --- a/src/main/java/com/seam/api/types/DeviceWarningsItem.java +++ b/src/main/java/com/seam/api/types/DeviceWarningsItem.java @@ -40,7 +40,7 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof DeviceWarningsItem && equalTo((DeviceWarningsItem) other); @@ -55,12 +55,12 @@ private boolean equalTo(DeviceWarningsItem other) { return warningCode.equals(other.warningCode) && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.warningCode, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +94,28 @@ public static final class Builder implements WarningCodeStage, MessageStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(DeviceWarningsItem other) { warningCode(other.getWarningCode()); message(other.getMessage()); return this; } - @Override + @java.lang.Override @JsonSetter("warning_code") public MessageStage warningCode(String warningCode) { this.warningCode = warningCode; return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(String message) { this.message = message; return this; } - @Override + @java.lang.Override public DeviceWarningsItem build() { return new DeviceWarningsItem(warningCode, message, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/DevicesUpdateRequestLocation.java b/src/main/java/com/seam/api/types/DevicesUpdateRequestLocation.java deleted file mode 100644 index 1626bf6..0000000 --- a/src/main/java/com/seam/api/types/DevicesUpdateRequestLocation.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.seam.api.core.ObjectMappers; -import java.util.Map; - -public final class DevicesUpdateRequestLocation { - private final Map additionalProperties; - - private DevicesUpdateRequestLocation(Map additionalProperties) { - this.additionalProperties = additionalProperties; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DevicesUpdateRequestLocation; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } -} diff --git a/src/main/java/com/seam/api/types/EnrollmentAutomation.java b/src/main/java/com/seam/api/types/EnrollmentAutomation.java new file mode 100644 index 0000000..049dafe --- /dev/null +++ b/src/main/java/com/seam/api/types/EnrollmentAutomation.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = EnrollmentAutomation.Builder.class) +public final class EnrollmentAutomation { + private final String credentialManagerAcsSystemId; + + private final String userIdentityId; + + private final OffsetDateTime createdAt; + + private final String workspaceId; + + private final String enrollmentAutomationId; + + private final Map additionalProperties; + + private EnrollmentAutomation( + String credentialManagerAcsSystemId, + String userIdentityId, + OffsetDateTime createdAt, + String workspaceId, + String enrollmentAutomationId, + Map additionalProperties) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + this.userIdentityId = userIdentityId; + this.createdAt = createdAt; + this.workspaceId = workspaceId; + this.enrollmentAutomationId = enrollmentAutomationId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("credential_manager_acs_system_id") + public String getCredentialManagerAcsSystemId() { + return credentialManagerAcsSystemId; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("enrollment_automation_id") + public String getEnrollmentAutomationId() { + return enrollmentAutomationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EnrollmentAutomation && equalTo((EnrollmentAutomation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EnrollmentAutomation other) { + return credentialManagerAcsSystemId.equals(other.credentialManagerAcsSystemId) + && userIdentityId.equals(other.userIdentityId) + && createdAt.equals(other.createdAt) + && workspaceId.equals(other.workspaceId) + && enrollmentAutomationId.equals(other.enrollmentAutomationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.credentialManagerAcsSystemId, + this.userIdentityId, + this.createdAt, + this.workspaceId, + this.enrollmentAutomationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CredentialManagerAcsSystemIdStage builder() { + return new Builder(); + } + + public interface CredentialManagerAcsSystemIdStage { + UserIdentityIdStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId); + + Builder from(EnrollmentAutomation other); + } + + public interface UserIdentityIdStage { + CreatedAtStage userIdentityId(String userIdentityId); + } + + public interface CreatedAtStage { + WorkspaceIdStage createdAt(OffsetDateTime createdAt); + } + + public interface WorkspaceIdStage { + EnrollmentAutomationIdStage workspaceId(String workspaceId); + } + + public interface EnrollmentAutomationIdStage { + _FinalStage enrollmentAutomationId(String enrollmentAutomationId); + } + + public interface _FinalStage { + EnrollmentAutomation build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CredentialManagerAcsSystemIdStage, + UserIdentityIdStage, + CreatedAtStage, + WorkspaceIdStage, + EnrollmentAutomationIdStage, + _FinalStage { + private String credentialManagerAcsSystemId; + + private String userIdentityId; + + private OffsetDateTime createdAt; + + private String workspaceId; + + private String enrollmentAutomationId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EnrollmentAutomation other) { + credentialManagerAcsSystemId(other.getCredentialManagerAcsSystemId()); + userIdentityId(other.getUserIdentityId()); + createdAt(other.getCreatedAt()); + workspaceId(other.getWorkspaceId()); + enrollmentAutomationId(other.getEnrollmentAutomationId()); + return this; + } + + @java.lang.Override + @JsonSetter("credential_manager_acs_system_id") + public UserIdentityIdStage credentialManagerAcsSystemId(String credentialManagerAcsSystemId) { + this.credentialManagerAcsSystemId = credentialManagerAcsSystemId; + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public CreatedAtStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public WorkspaceIdStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public EnrollmentAutomationIdStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + @JsonSetter("enrollment_automation_id") + public _FinalStage enrollmentAutomationId(String enrollmentAutomationId) { + this.enrollmentAutomationId = enrollmentAutomationId; + return this; + } + + @java.lang.Override + public EnrollmentAutomation build() { + return new EnrollmentAutomation( + credentialManagerAcsSystemId, + userIdentityId, + createdAt, + workspaceId, + enrollmentAutomationId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/Event.java b/src/main/java/com/seam/api/types/Event.java index 56d87f5..e16909a 100644 --- a/src/main/java/com/seam/api/types/Event.java +++ b/src/main/java/com/seam/api/types/Event.java @@ -25,6 +25,18 @@ public final class Event { private final Optional deviceId; + private final Optional actionAttemptId; + + private final Optional acsCredentialId; + + private final Optional acsUserId; + + private final Optional acsSystemId; + + private final Optional clientSessionId; + + private final Optional enrollmentAutomationId; + private final String eventType; private final String workspaceId; @@ -38,6 +50,12 @@ public final class Event { private Event( String eventId, Optional deviceId, + Optional actionAttemptId, + Optional acsCredentialId, + Optional acsUserId, + Optional acsSystemId, + Optional clientSessionId, + Optional enrollmentAutomationId, String eventType, String workspaceId, OffsetDateTime createdAt, @@ -45,6 +63,12 @@ private Event( Map additionalProperties) { this.eventId = eventId; this.deviceId = deviceId; + this.actionAttemptId = actionAttemptId; + this.acsCredentialId = acsCredentialId; + this.acsUserId = acsUserId; + this.acsSystemId = acsSystemId; + this.clientSessionId = clientSessionId; + this.enrollmentAutomationId = enrollmentAutomationId; this.eventType = eventType; this.workspaceId = workspaceId; this.createdAt = createdAt; @@ -62,6 +86,36 @@ public Optional getDeviceId() { return deviceId; } + @JsonProperty("action_attempt_id") + public Optional getActionAttemptId() { + return actionAttemptId; + } + + @JsonProperty("acs_credential_id") + public Optional getAcsCredentialId() { + return acsCredentialId; + } + + @JsonProperty("acs_user_id") + public Optional getAcsUserId() { + return acsUserId; + } + + @JsonProperty("acs_system_id") + public Optional getAcsSystemId() { + return acsSystemId; + } + + @JsonProperty("client_session_id") + public Optional getClientSessionId() { + return clientSessionId; + } + + @JsonProperty("enrollment_automation_id") + public Optional getEnrollmentAutomationId() { + return enrollmentAutomationId; + } + @JsonProperty("event_type") public String getEventType() { return eventType; @@ -82,7 +136,7 @@ public OffsetDateTime getOccurredAt() { return occurredAt; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Event && equalTo((Event) other); @@ -96,19 +150,36 @@ public Map getAdditionalProperties() { private boolean equalTo(Event other) { return eventId.equals(other.eventId) && deviceId.equals(other.deviceId) + && actionAttemptId.equals(other.actionAttemptId) + && acsCredentialId.equals(other.acsCredentialId) + && acsUserId.equals(other.acsUserId) + && acsSystemId.equals(other.acsSystemId) + && clientSessionId.equals(other.clientSessionId) + && enrollmentAutomationId.equals(other.enrollmentAutomationId) && eventType.equals(other.eventType) && workspaceId.equals(other.workspaceId) && createdAt.equals(other.createdAt) && occurredAt.equals(other.occurredAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( - this.eventId, this.deviceId, this.eventType, this.workspaceId, this.createdAt, this.occurredAt); + this.eventId, + this.deviceId, + this.actionAttemptId, + this.acsCredentialId, + this.acsUserId, + this.acsSystemId, + this.clientSessionId, + this.enrollmentAutomationId, + this.eventType, + this.workspaceId, + this.createdAt, + this.occurredAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -145,6 +216,30 @@ public interface _FinalStage { _FinalStage deviceId(Optional deviceId); _FinalStage deviceId(String deviceId); + + _FinalStage actionAttemptId(Optional actionAttemptId); + + _FinalStage actionAttemptId(String actionAttemptId); + + _FinalStage acsCredentialId(Optional acsCredentialId); + + _FinalStage acsCredentialId(String acsCredentialId); + + _FinalStage acsUserId(Optional acsUserId); + + _FinalStage acsUserId(String acsUserId); + + _FinalStage acsSystemId(Optional acsSystemId); + + _FinalStage acsSystemId(String acsSystemId); + + _FinalStage clientSessionId(Optional clientSessionId); + + _FinalStage clientSessionId(String clientSessionId); + + _FinalStage enrollmentAutomationId(Optional enrollmentAutomationId); + + _FinalStage enrollmentAutomationId(String enrollmentAutomationId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -160,6 +255,18 @@ public static final class Builder private OffsetDateTime occurredAt; + private Optional enrollmentAutomationId = Optional.empty(); + + private Optional clientSessionId = Optional.empty(); + + private Optional acsSystemId = Optional.empty(); + + private Optional acsUserId = Optional.empty(); + + private Optional acsCredentialId = Optional.empty(); + + private Optional actionAttemptId = Optional.empty(); + private Optional deviceId = Optional.empty(); @JsonAnySetter @@ -167,10 +274,16 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(Event other) { eventId(other.getEventId()); deviceId(other.getDeviceId()); + actionAttemptId(other.getActionAttemptId()); + acsCredentialId(other.getAcsCredentialId()); + acsUserId(other.getAcsUserId()); + acsSystemId(other.getAcsSystemId()); + clientSessionId(other.getClientSessionId()); + enrollmentAutomationId(other.getEnrollmentAutomationId()); eventType(other.getEventType()); workspaceId(other.getWorkspaceId()); createdAt(other.getCreatedAt()); @@ -178,57 +291,148 @@ public Builder from(Event other) { return this; } - @Override + @java.lang.Override @JsonSetter("event_id") public EventTypeStage eventId(String eventId) { this.eventId = eventId; return this; } - @Override + @java.lang.Override @JsonSetter("event_type") public WorkspaceIdStage eventType(String eventType) { this.eventType = eventType; return this; } - @Override + @java.lang.Override @JsonSetter("workspace_id") public CreatedAtStage workspaceId(String workspaceId) { this.workspaceId = workspaceId; return this; } - @Override + @java.lang.Override @JsonSetter("created_at") public OccurredAtStage createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override @JsonSetter("occurred_at") public _FinalStage occurredAt(OffsetDateTime occurredAt) { this.occurredAt = occurredAt; return this; } - @Override + @java.lang.Override + public _FinalStage enrollmentAutomationId(String enrollmentAutomationId) { + this.enrollmentAutomationId = Optional.of(enrollmentAutomationId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enrollment_automation_id", nulls = Nulls.SKIP) + public _FinalStage enrollmentAutomationId(Optional enrollmentAutomationId) { + this.enrollmentAutomationId = enrollmentAutomationId; + return this; + } + + @java.lang.Override + public _FinalStage clientSessionId(String clientSessionId) { + this.clientSessionId = Optional.of(clientSessionId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "client_session_id", nulls = Nulls.SKIP) + public _FinalStage clientSessionId(Optional clientSessionId) { + this.clientSessionId = clientSessionId; + return this; + } + + @java.lang.Override + public _FinalStage acsSystemId(String acsSystemId) { + this.acsSystemId = Optional.of(acsSystemId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_system_id", nulls = Nulls.SKIP) + public _FinalStage acsSystemId(Optional acsSystemId) { + this.acsSystemId = acsSystemId; + return this; + } + + @java.lang.Override + public _FinalStage acsUserId(String acsUserId) { + this.acsUserId = Optional.of(acsUserId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_user_id", nulls = Nulls.SKIP) + public _FinalStage acsUserId(Optional acsUserId) { + this.acsUserId = acsUserId; + return this; + } + + @java.lang.Override + public _FinalStage acsCredentialId(String acsCredentialId) { + this.acsCredentialId = Optional.of(acsCredentialId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "acs_credential_id", nulls = Nulls.SKIP) + public _FinalStage acsCredentialId(Optional acsCredentialId) { + this.acsCredentialId = acsCredentialId; + return this; + } + + @java.lang.Override + public _FinalStage actionAttemptId(String actionAttemptId) { + this.actionAttemptId = Optional.of(actionAttemptId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "action_attempt_id", nulls = Nulls.SKIP) + public _FinalStage actionAttemptId(Optional actionAttemptId) { + this.actionAttemptId = actionAttemptId; + return this; + } + + @java.lang.Override public _FinalStage deviceId(String deviceId) { this.deviceId = Optional.of(deviceId); return this; } - @Override + @java.lang.Override @JsonSetter(value = "device_id", nulls = Nulls.SKIP) public _FinalStage deviceId(Optional deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override public Event build() { - return new Event(eventId, deviceId, eventType, workspaceId, createdAt, occurredAt, additionalProperties); + return new Event( + eventId, + deviceId, + actionAttemptId, + acsCredentialId, + acsUserId, + acsSystemId, + clientSessionId, + enrollmentAutomationId, + eventType, + workspaceId, + createdAt, + occurredAt, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/EventsListRequestEventTypesItem.java b/src/main/java/com/seam/api/types/EventType.java similarity index 64% rename from src/main/java/com/seam/api/types/EventsListRequestEventTypesItem.java rename to src/main/java/com/seam/api/types/EventType.java index f6084ae..a7429a4 100644 --- a/src/main/java/com/seam/api/types/EventsListRequestEventTypesItem.java +++ b/src/main/java/com/seam/api/types/EventType.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum EventsListRequestEventTypesItem { +public enum EventType { DEVICE_CONNECTED("device.connected"), DEVICE_UNMANAGED_CONNECTED("device.unmanaged.connected"), @@ -26,6 +26,22 @@ public enum EventsListRequestEventTypesItem { DEVICE_BATTERY_STATUS_CHANGED("device.battery_status_changed"), + DEVICE_THIRD_PARTY_INTEGRATION_DETECTED("device.third_party_integration_detected"), + + DEVICE_THIRD_PARTY_INTEGRATION_NO_LONGER_DETECTED("device.third_party_integration_no_longer_detected"), + + DEVICE_SALTO_PRIVACY_MODE_ACTIVATED("device.salto.privacy_mode_activated"), + + DEVICE_SALTO_PRIVACY_MODE_DEACTIVATED("device.salto.privacy_mode_deactivated"), + + DEVICE_CONNECTION_BECAME_FLAKY("device.connection_became_flaky"), + + DEVICE_CONNECTION_STABILIZED("device.connection_stabilized"), + + DEVICE_ERROR_SUBSCRIPTION_REQUIRED("device.error.subscription_required"), + + DEVICE_ERROR_SUBSCRIPTION_REQUIRED_RESOLVED("device.error.subscription_required.resolved"), + ACCESS_CODE_CREATED("access_code.created"), ACCESS_CODE_CHANGED("access_code.changed"), @@ -46,6 +62,10 @@ public enum EventsListRequestEventTypesItem { ACCESS_CODE_DELAY_IN_REMOVING_FROM_DEVICE("access_code.delay_in_removing_from_device"), + ACCESS_CODE_DELETED_EXTERNAL_TO_SEAM("access_code.deleted_external_to_seam"), + + ACCESS_CODE_MODIFIED_EXTERNAL_TO_SEAM("access_code.modified_external_to_seam"), + ACCESS_CODE_UNMANAGED_CONVERTED_TO_MANAGED("access_code.unmanaged.converted_to_managed"), ACCESS_CODE_UNMANAGED_FAILED_TO_CONVERT_TO_MANAGED("access_code.unmanaged.failed_to_convert_to_managed"), @@ -60,24 +80,38 @@ public enum EventsListRequestEventTypesItem { CONNECTED_ACCOUNT_CONNECTED("connected_account.connected"), + CONNECTED_ACCOUNT_SUCCESSFUL_LOGIN("connected_account.successful_login"), + CONNECTED_ACCOUNT_CREATED("connected_account.created"), + CONNECTED_ACCOUNT_DELETED("connected_account.deleted"), + CONNECTED_ACCOUNT_DISCONNECTED("connected_account.disconnected"), CONNECTED_ACCOUNT_COMPLETED_FIRST_SYNC("connected_account.completed_first_sync"), NOISE_SENSOR_NOISE_THRESHOLD_TRIGGERED("noise_sensor.noise_threshold_triggered"), - ACCESS_CODE_BACKUP_ACCESS_CODE_PULLED("access_code.backup_access_code_pulled"); + ACCESS_CODE_BACKUP_ACCESS_CODE_PULLED("access_code.backup_access_code_pulled"), + + ENROLLMENT_AUTOMATION_DELETED("enrollment_automation.deleted"), + + ACS_USER_DELETED("acs_user.deleted"), + + ACS_CREDENTIAL_DELETED("acs_credential.deleted"), + + PHONE_DEACTIVATED("phone.deactivated"), + + CLIENT_SESSION_DELETED("client_session.deleted"); private final String value; - EventsListRequestEventTypesItem(String value) { + EventType(String value) { this.value = value; } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/EventsListRequestEventType.java b/src/main/java/com/seam/api/types/EventsListRequestEventType.java deleted file mode 100644 index 97c63db..0000000 --- a/src/main/java/com/seam/api/types/EventsListRequestEventType.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EventsListRequestEventType { - DEVICE_CONNECTED("device.connected"), - - DEVICE_UNMANAGED_CONNECTED("device.unmanaged.connected"), - - DEVICE_DISCONNECTED("device.disconnected"), - - DEVICE_UNMANAGED_DISCONNECTED("device.unmanaged.disconnected"), - - DEVICE_CONVERTED_TO_UNMANAGED("device.converted_to_unmanaged"), - - DEVICE_UNMANAGED_CONVERTED_TO_MANAGED("device.unmanaged.converted_to_managed"), - - DEVICE_REMOVED("device.removed"), - - DEVICE_TAMPERED("device.tampered"), - - DEVICE_LOW_BATTERY("device.low_battery"), - - DEVICE_BATTERY_STATUS_CHANGED("device.battery_status_changed"), - - ACCESS_CODE_CREATED("access_code.created"), - - ACCESS_CODE_CHANGED("access_code.changed"), - - ACCESS_CODE_SCHEDULED_ON_DEVICE("access_code.scheduled_on_device"), - - ACCESS_CODE_SET_ON_DEVICE("access_code.set_on_device"), - - ACCESS_CODE_DELETED("access_code.deleted"), - - ACCESS_CODE_REMOVED_FROM_DEVICE("access_code.removed_from_device"), - - ACCESS_CODE_FAILED_TO_SET_ON_DEVICE("access_code.failed_to_set_on_device"), - - ACCESS_CODE_DELAY_IN_SETTING_ON_DEVICE("access_code.delay_in_setting_on_device"), - - ACCESS_CODE_FAILED_TO_REMOVE_FROM_DEVICE("access_code.failed_to_remove_from_device"), - - ACCESS_CODE_DELAY_IN_REMOVING_FROM_DEVICE("access_code.delay_in_removing_from_device"), - - ACCESS_CODE_UNMANAGED_CONVERTED_TO_MANAGED("access_code.unmanaged.converted_to_managed"), - - ACCESS_CODE_UNMANAGED_FAILED_TO_CONVERT_TO_MANAGED("access_code.unmanaged.failed_to_convert_to_managed"), - - ACCESS_CODE_UNMANAGED_CREATED("access_code.unmanaged.created"), - - ACCESS_CODE_UNMANAGED_REMOVED("access_code.unmanaged.removed"), - - LOCK_LOCKED("lock.locked"), - - LOCK_UNLOCKED("lock.unlocked"), - - CONNECTED_ACCOUNT_CONNECTED("connected_account.connected"), - - CONNECTED_ACCOUNT_CREATED("connected_account.created"), - - CONNECTED_ACCOUNT_DISCONNECTED("connected_account.disconnected"), - - CONNECTED_ACCOUNT_COMPLETED_FIRST_SYNC("connected_account.completed_first_sync"), - - NOISE_SENSOR_NOISE_THRESHOLD_TRIGGERED("noise_sensor.noise_threshold_triggered"), - - ACCESS_CODE_BACKUP_ACCESS_CODE_PULLED("access_code.backup_access_code_pulled"); - - private final String value; - - EventsListRequestEventType(String value) { - this.value = value; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/seam/api/types/FanMode.java b/src/main/java/com/seam/api/types/FanMode.java new file mode 100644 index 0000000..374a543 --- /dev/null +++ b/src/main/java/com/seam/api/types/FanMode.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FanMode { + AUTO("auto"), + + ON("on"); + + private final String value; + + FanMode(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/FanModeSetting.java b/src/main/java/com/seam/api/types/FanModeSetting.java index 18370e3..1abdb41 100644 --- a/src/main/java/com/seam/api/types/FanModeSetting.java +++ b/src/main/java/com/seam/api/types/FanModeSetting.java @@ -17,7 +17,7 @@ public enum FanModeSetting { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/HealthGetHealthResponse.java b/src/main/java/com/seam/api/types/HealthGetHealthResponse.java deleted file mode 100644 index 7e97d20..0000000 --- a/src/main/java/com/seam/api/types/HealthGetHealthResponse.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = HealthGetHealthResponse.Builder.class) -public final class HealthGetHealthResponse { - private final boolean ok; - - private final Optional lastServiceEvaluationAt; - - private final List serviceHealthStatuses; - - private final Map additionalProperties; - - private HealthGetHealthResponse( - boolean ok, - Optional lastServiceEvaluationAt, - List serviceHealthStatuses, - Map additionalProperties) { - this.ok = ok; - this.lastServiceEvaluationAt = lastServiceEvaluationAt; - this.serviceHealthStatuses = serviceHealthStatuses; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("ok") - public boolean getOk() { - return ok; - } - - @JsonProperty("msg") - public String getMsg() { - return "I’m one with the Force. The Force is with me."; - } - - @JsonProperty("last_service_evaluation_at") - public Optional getLastServiceEvaluationAt() { - return lastServiceEvaluationAt; - } - - @JsonProperty("service_health_statuses") - public List getServiceHealthStatuses() { - return serviceHealthStatuses; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof HealthGetHealthResponse && equalTo((HealthGetHealthResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(HealthGetHealthResponse other) { - return ok == other.ok - && lastServiceEvaluationAt.equals(other.lastServiceEvaluationAt) - && serviceHealthStatuses.equals(other.serviceHealthStatuses); - } - - @Override - public int hashCode() { - return Objects.hash(this.ok, this.lastServiceEvaluationAt, this.serviceHealthStatuses); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static OkStage builder() { - return new Builder(); - } - - public interface OkStage { - _FinalStage ok(boolean ok); - - Builder from(HealthGetHealthResponse other); - } - - public interface _FinalStage { - HealthGetHealthResponse build(); - - _FinalStage lastServiceEvaluationAt(Optional lastServiceEvaluationAt); - - _FinalStage lastServiceEvaluationAt(String lastServiceEvaluationAt); - - _FinalStage serviceHealthStatuses(List serviceHealthStatuses); - - _FinalStage addServiceHealthStatuses(ServiceHealth serviceHealthStatuses); - - _FinalStage addAllServiceHealthStatuses(List serviceHealthStatuses); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements OkStage, _FinalStage { - private boolean ok; - - private List serviceHealthStatuses = new ArrayList<>(); - - private Optional lastServiceEvaluationAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(HealthGetHealthResponse other) { - ok(other.getOk()); - lastServiceEvaluationAt(other.getLastServiceEvaluationAt()); - serviceHealthStatuses(other.getServiceHealthStatuses()); - return this; - } - - @Override - @JsonSetter("ok") - public _FinalStage ok(boolean ok) { - this.ok = ok; - return this; - } - - @Override - public _FinalStage addAllServiceHealthStatuses(List serviceHealthStatuses) { - this.serviceHealthStatuses.addAll(serviceHealthStatuses); - return this; - } - - @Override - public _FinalStage addServiceHealthStatuses(ServiceHealth serviceHealthStatuses) { - this.serviceHealthStatuses.add(serviceHealthStatuses); - return this; - } - - @Override - @JsonSetter(value = "service_health_statuses", nulls = Nulls.SKIP) - public _FinalStage serviceHealthStatuses(List serviceHealthStatuses) { - this.serviceHealthStatuses.clear(); - this.serviceHealthStatuses.addAll(serviceHealthStatuses); - return this; - } - - @Override - public _FinalStage lastServiceEvaluationAt(String lastServiceEvaluationAt) { - this.lastServiceEvaluationAt = Optional.of(lastServiceEvaluationAt); - return this; - } - - @Override - @JsonSetter(value = "last_service_evaluation_at", nulls = Nulls.SKIP) - public _FinalStage lastServiceEvaluationAt(Optional lastServiceEvaluationAt) { - this.lastServiceEvaluationAt = lastServiceEvaluationAt; - return this; - } - - @Override - public HealthGetHealthResponse build() { - return new HealthGetHealthResponse( - ok, lastServiceEvaluationAt, serviceHealthStatuses, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/types/HealthGetServiceHealthResponse.java b/src/main/java/com/seam/api/types/HealthGetServiceHealthResponse.java deleted file mode 100644 index 64b86b3..0000000 --- a/src/main/java/com/seam/api/types/HealthGetServiceHealthResponse.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = HealthGetServiceHealthResponse.Builder.class) -public final class HealthGetServiceHealthResponse { - private final boolean ok; - - private final String lastServiceEvaluationAt; - - private final ServiceHealth serviceHealth; - - private final Map additionalProperties; - - private HealthGetServiceHealthResponse( - boolean ok, - String lastServiceEvaluationAt, - ServiceHealth serviceHealth, - Map additionalProperties) { - this.ok = ok; - this.lastServiceEvaluationAt = lastServiceEvaluationAt; - this.serviceHealth = serviceHealth; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("ok") - public boolean getOk() { - return ok; - } - - @JsonProperty("last_service_evaluation_at") - public String getLastServiceEvaluationAt() { - return lastServiceEvaluationAt; - } - - @JsonProperty("service_health") - public ServiceHealth getServiceHealth() { - return serviceHealth; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof HealthGetServiceHealthResponse && equalTo((HealthGetServiceHealthResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(HealthGetServiceHealthResponse other) { - return ok == other.ok - && lastServiceEvaluationAt.equals(other.lastServiceEvaluationAt) - && serviceHealth.equals(other.serviceHealth); - } - - @Override - public int hashCode() { - return Objects.hash(this.ok, this.lastServiceEvaluationAt, this.serviceHealth); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static OkStage builder() { - return new Builder(); - } - - public interface OkStage { - LastServiceEvaluationAtStage ok(boolean ok); - - Builder from(HealthGetServiceHealthResponse other); - } - - public interface LastServiceEvaluationAtStage { - ServiceHealthStage lastServiceEvaluationAt(String lastServiceEvaluationAt); - } - - public interface ServiceHealthStage { - _FinalStage serviceHealth(ServiceHealth serviceHealth); - } - - public interface _FinalStage { - HealthGetServiceHealthResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements OkStage, LastServiceEvaluationAtStage, ServiceHealthStage, _FinalStage { - private boolean ok; - - private String lastServiceEvaluationAt; - - private ServiceHealth serviceHealth; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(HealthGetServiceHealthResponse other) { - ok(other.getOk()); - lastServiceEvaluationAt(other.getLastServiceEvaluationAt()); - serviceHealth(other.getServiceHealth()); - return this; - } - - @Override - @JsonSetter("ok") - public LastServiceEvaluationAtStage ok(boolean ok) { - this.ok = ok; - return this; - } - - @Override - @JsonSetter("last_service_evaluation_at") - public ServiceHealthStage lastServiceEvaluationAt(String lastServiceEvaluationAt) { - this.lastServiceEvaluationAt = lastServiceEvaluationAt; - return this; - } - - @Override - @JsonSetter("service_health") - public _FinalStage serviceHealth(ServiceHealth serviceHealth) { - this.serviceHealth = serviceHealth; - return this; - } - - @Override - public HealthGetServiceHealthResponse build() { - return new HealthGetServiceHealthResponse(ok, lastServiceEvaluationAt, serviceHealth, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/types/HvacModeSetting.java b/src/main/java/com/seam/api/types/HvacModeSetting.java index 1e083d1..6eba645 100644 --- a/src/main/java/com/seam/api/types/HvacModeSetting.java +++ b/src/main/java/com/seam/api/types/HvacModeSetting.java @@ -21,7 +21,7 @@ public enum HvacModeSetting { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/Manufacturer.java b/src/main/java/com/seam/api/types/Manufacturer.java index 0bd2d17..a224573 100644 --- a/src/main/java/com/seam/api/types/Manufacturer.java +++ b/src/main/java/com/seam/api/types/Manufacturer.java @@ -10,12 +10,16 @@ public enum Manufacturer { AUGUST("august"), + AVIGILON_ALTA("avigilon_alta"), + BRIVO("brivo"), BUTTERFLYMX("butterflymx"), DOORKING("doorking"), + FOUR_SUITES("four_suites"), + GENIE("genie"), IGLOO("igloo"), @@ -42,6 +46,8 @@ public enum Manufacturer { UNKNOWN("unknown"), + WYZE("wyze"), + YALE("yale"), MINUT("minut"), @@ -56,7 +62,13 @@ public enum Manufacturer { ECOBEE("ecobee"), - HUBITAT("hubitat"); + HUBITAT("hubitat"), + + CONTROLBYWEB("controlbyweb"), + + SMARTTHINGS("smartthings"), + + DORMAKABA_ORACODE("dormakaba_oracode"); private final String value; @@ -65,7 +77,7 @@ public enum Manufacturer { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/MaxTimeRounding.java b/src/main/java/com/seam/api/types/MaxTimeRounding.java new file mode 100644 index 0000000..82f3bab --- /dev/null +++ b/src/main/java/com/seam/api/types/MaxTimeRounding.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MaxTimeRounding { + ONE_HOUR("1hour"), + + ONE_DAY("1day"), + + ONE_H("1h"), + + ONE_D("1d"); + + private final String value; + + MaxTimeRounding(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/Network.java b/src/main/java/com/seam/api/types/Network.java new file mode 100644 index 0000000..9501f09 --- /dev/null +++ b/src/main/java/com/seam/api/types/Network.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = Network.Builder.class) +public final class Network { + private final String networkId; + + private final String workspaceId; + + private final String displayName; + + private final OffsetDateTime createdAt; + + private final Map additionalProperties; + + private Network( + String networkId, + String workspaceId, + String displayName, + OffsetDateTime createdAt, + Map additionalProperties) { + this.networkId = networkId; + this.workspaceId = workspaceId; + this.displayName = displayName; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("network_id") + public String getNetworkId() { + return networkId; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Network && equalTo((Network) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Network other) { + return networkId.equals(other.networkId) + && workspaceId.equals(other.workspaceId) + && displayName.equals(other.displayName) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.networkId, this.workspaceId, this.displayName, this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NetworkIdStage builder() { + return new Builder(); + } + + public interface NetworkIdStage { + WorkspaceIdStage networkId(String networkId); + + Builder from(Network other); + } + + public interface WorkspaceIdStage { + DisplayNameStage workspaceId(String workspaceId); + } + + public interface DisplayNameStage { + CreatedAtStage displayName(String displayName); + } + + public interface CreatedAtStage { + _FinalStage createdAt(OffsetDateTime createdAt); + } + + public interface _FinalStage { + Network build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NetworkIdStage, WorkspaceIdStage, DisplayNameStage, CreatedAtStage, _FinalStage { + private String networkId; + + private String workspaceId; + + private String displayName; + + private OffsetDateTime createdAt; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Network other) { + networkId(other.getNetworkId()); + workspaceId(other.getWorkspaceId()); + displayName(other.getDisplayName()); + createdAt(other.getCreatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("network_id") + public WorkspaceIdStage networkId(String networkId) { + this.networkId = networkId; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public DisplayNameStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + @JsonSetter("display_name") + public CreatedAtStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + public Network build() { + return new Network(networkId, workspaceId, displayName, createdAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/NoiseThreshold.java b/src/main/java/com/seam/api/types/NoiseThreshold.java index 7cf3745..225f150 100644 --- a/src/main/java/com/seam/api/types/NoiseThreshold.java +++ b/src/main/java/com/seam/api/types/NoiseThreshold.java @@ -90,7 +90,7 @@ public double getNoiseThresholdDecibels() { return noiseThresholdDecibels; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof NoiseThreshold && equalTo((NoiseThreshold) other); @@ -111,7 +111,7 @@ private boolean equalTo(NoiseThreshold other) { && noiseThresholdDecibels == other.noiseThresholdDecibels; } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.noiseThresholdId, @@ -123,7 +123,7 @@ public int hashCode() { this.noiseThresholdDecibels); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -194,7 +194,7 @@ public static final class Builder private Builder() {} - @Override + @java.lang.Override public Builder from(NoiseThreshold other) { noiseThresholdId(other.getNoiseThresholdId()); deviceId(other.getDeviceId()); @@ -206,62 +206,62 @@ public Builder from(NoiseThreshold other) { return this; } - @Override + @java.lang.Override @JsonSetter("noise_threshold_id") public DeviceIdStage noiseThresholdId(String noiseThresholdId) { this.noiseThresholdId = noiseThresholdId; return this; } - @Override + @java.lang.Override @JsonSetter("device_id") public NameStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + @java.lang.Override @JsonSetter("name") public StartsDailyAtStage name(String name) { this.name = name; return this; } - @Override + @java.lang.Override @JsonSetter("starts_daily_at") public EndsDailyAtStage startsDailyAt(String startsDailyAt) { this.startsDailyAt = startsDailyAt; return this; } - @Override + @java.lang.Override @JsonSetter("ends_daily_at") public NoiseThresholdDecibelsStage endsDailyAt(String endsDailyAt) { this.endsDailyAt = endsDailyAt; return this; } - @Override + @java.lang.Override @JsonSetter("noise_threshold_decibels") public _FinalStage noiseThresholdDecibels(double noiseThresholdDecibels) { this.noiseThresholdDecibels = noiseThresholdDecibels; return this; } - @Override + @java.lang.Override public _FinalStage noiseThresholdNrs(Double noiseThresholdNrs) { this.noiseThresholdNrs = Optional.of(noiseThresholdNrs); return this; } - @Override + @java.lang.Override @JsonSetter(value = "noise_threshold_nrs", nulls = Nulls.SKIP) public _FinalStage noiseThresholdNrs(Optional noiseThresholdNrs) { this.noiseThresholdNrs = noiseThresholdNrs; return this; } - @Override + @java.lang.Override public NoiseThreshold build() { return new NoiseThreshold( noiseThresholdId, diff --git a/src/main/java/com/seam/api/types/Phone.java b/src/main/java/com/seam/api/types/Phone.java new file mode 100644 index 0000000..2fd64f6 --- /dev/null +++ b/src/main/java/com/seam/api/types/Phone.java @@ -0,0 +1,810 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = Phone.Builder.class) +public final class Phone { + private final String deviceId; + + private final PhoneDeviceType deviceType; + + private final Optional nickname; + + private final String displayName; + + private final List capabilitiesSupported; + + private final PhoneProperties properties; + + private final Optional location; + + private final String workspaceId; + + private final List errors; + + private final List warnings; + + private final OffsetDateTime createdAt; + + private final boolean isManaged; + + private final Map customMetadata; + + private final Optional canRemotelyUnlock; + + private final Optional canRemotelyLock; + + private final Optional canProgramOfflineAccessCodes; + + private final Optional canProgramOnlineAccessCodes; + + private final Optional canSimulateRemoval; + + private final Optional canSimulateConnection; + + private final Optional canSimulateDisconnection; + + private final Map additionalProperties; + + private Phone( + String deviceId, + PhoneDeviceType deviceType, + Optional nickname, + String displayName, + List capabilitiesSupported, + PhoneProperties properties, + Optional location, + String workspaceId, + List errors, + List warnings, + OffsetDateTime createdAt, + boolean isManaged, + Map customMetadata, + Optional canRemotelyUnlock, + Optional canRemotelyLock, + Optional canProgramOfflineAccessCodes, + Optional canProgramOnlineAccessCodes, + Optional canSimulateRemoval, + Optional canSimulateConnection, + Optional canSimulateDisconnection, + Map additionalProperties) { + this.deviceId = deviceId; + this.deviceType = deviceType; + this.nickname = nickname; + this.displayName = displayName; + this.capabilitiesSupported = capabilitiesSupported; + this.properties = properties; + this.location = location; + this.workspaceId = workspaceId; + this.errors = errors; + this.warnings = warnings; + this.createdAt = createdAt; + this.isManaged = isManaged; + this.customMetadata = customMetadata; + this.canRemotelyUnlock = canRemotelyUnlock; + this.canRemotelyLock = canRemotelyLock; + this.canProgramOfflineAccessCodes = canProgramOfflineAccessCodes; + this.canProgramOnlineAccessCodes = canProgramOnlineAccessCodes; + this.canSimulateRemoval = canSimulateRemoval; + this.canSimulateConnection = canSimulateConnection; + this.canSimulateDisconnection = canSimulateDisconnection; + this.additionalProperties = additionalProperties; + } + + /** + * @return Unique identifier for the device. + */ + @JsonProperty("device_id") + public String getDeviceId() { + return deviceId; + } + + @JsonProperty("device_type") + public PhoneDeviceType getDeviceType() { + return deviceType; + } + + /** + * @return Optional nickname to describe the device, settable through Seam + */ + @JsonProperty("nickname") + public Optional getNickname() { + return nickname; + } + + /** + * @return Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + */ + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + /** + * @return Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health. + */ + @JsonProperty("capabilities_supported") + public List getCapabilitiesSupported() { + return capabilitiesSupported; + } + + @JsonProperty("properties") + public PhoneProperties getProperties() { + return properties; + } + + /** + * @return Location information for the device. + */ + @JsonProperty("location") + public Optional getLocation() { + return location; + } + + /** + * @return Unique identifier for the Seam workspace associated with the device. + */ + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + /** + * @return Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + */ + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + /** + * @return Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + */ + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + /** + * @return Date and time at which the device object was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Indicates whether Seam manages the device. + */ + @JsonProperty("is_managed") + public boolean getIsManaged() { + return isManaged; + } + + @JsonProperty("custom_metadata") + public Map getCustomMetadata() { + return customMetadata; + } + + @JsonProperty("can_remotely_unlock") + public Optional getCanRemotelyUnlock() { + return canRemotelyUnlock; + } + + @JsonProperty("can_remotely_lock") + public Optional getCanRemotelyLock() { + return canRemotelyLock; + } + + @JsonProperty("can_program_offline_access_codes") + public Optional getCanProgramOfflineAccessCodes() { + return canProgramOfflineAccessCodes; + } + + @JsonProperty("can_program_online_access_codes") + public Optional getCanProgramOnlineAccessCodes() { + return canProgramOnlineAccessCodes; + } + + @JsonProperty("can_simulate_removal") + public Optional getCanSimulateRemoval() { + return canSimulateRemoval; + } + + @JsonProperty("can_simulate_connection") + public Optional getCanSimulateConnection() { + return canSimulateConnection; + } + + @JsonProperty("can_simulate_disconnection") + public Optional getCanSimulateDisconnection() { + return canSimulateDisconnection; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Phone && equalTo((Phone) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Phone other) { + return deviceId.equals(other.deviceId) + && deviceType.equals(other.deviceType) + && nickname.equals(other.nickname) + && displayName.equals(other.displayName) + && capabilitiesSupported.equals(other.capabilitiesSupported) + && properties.equals(other.properties) + && location.equals(other.location) + && workspaceId.equals(other.workspaceId) + && errors.equals(other.errors) + && warnings.equals(other.warnings) + && createdAt.equals(other.createdAt) + && isManaged == other.isManaged + && customMetadata.equals(other.customMetadata) + && canRemotelyUnlock.equals(other.canRemotelyUnlock) + && canRemotelyLock.equals(other.canRemotelyLock) + && canProgramOfflineAccessCodes.equals(other.canProgramOfflineAccessCodes) + && canProgramOnlineAccessCodes.equals(other.canProgramOnlineAccessCodes) + && canSimulateRemoval.equals(other.canSimulateRemoval) + && canSimulateConnection.equals(other.canSimulateConnection) + && canSimulateDisconnection.equals(other.canSimulateDisconnection); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.deviceId, + this.deviceType, + this.nickname, + this.displayName, + this.capabilitiesSupported, + this.properties, + this.location, + this.workspaceId, + this.errors, + this.warnings, + this.createdAt, + this.isManaged, + this.customMetadata, + this.canRemotelyUnlock, + this.canRemotelyLock, + this.canProgramOfflineAccessCodes, + this.canProgramOnlineAccessCodes, + this.canSimulateRemoval, + this.canSimulateConnection, + this.canSimulateDisconnection); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DeviceIdStage builder() { + return new Builder(); + } + + public interface DeviceIdStage { + DeviceTypeStage deviceId(String deviceId); + + Builder from(Phone other); + } + + public interface DeviceTypeStage { + DisplayNameStage deviceType(PhoneDeviceType deviceType); + } + + public interface DisplayNameStage { + PropertiesStage displayName(String displayName); + } + + public interface PropertiesStage { + WorkspaceIdStage properties(PhoneProperties properties); + } + + public interface WorkspaceIdStage { + CreatedAtStage workspaceId(String workspaceId); + } + + public interface CreatedAtStage { + IsManagedStage createdAt(OffsetDateTime createdAt); + } + + public interface IsManagedStage { + _FinalStage isManaged(boolean isManaged); + } + + public interface _FinalStage { + Phone build(); + + _FinalStage nickname(Optional nickname); + + _FinalStage nickname(String nickname); + + _FinalStage capabilitiesSupported(List capabilitiesSupported); + + _FinalStage addCapabilitiesSupported(PhoneCapabilitiesSupportedItem capabilitiesSupported); + + _FinalStage addAllCapabilitiesSupported(List capabilitiesSupported); + + _FinalStage location(Optional location); + + _FinalStage location(PhoneLocation location); + + _FinalStage errors(List errors); + + _FinalStage addErrors(PhoneErrorsItem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(PhoneWarningsItem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage customMetadata(Map customMetadata); + + _FinalStage putAllCustomMetadata(Map customMetadata); + + _FinalStage customMetadata(String key, PhoneCustomMetadataValue value); + + _FinalStage canRemotelyUnlock(Optional canRemotelyUnlock); + + _FinalStage canRemotelyUnlock(Boolean canRemotelyUnlock); + + _FinalStage canRemotelyLock(Optional canRemotelyLock); + + _FinalStage canRemotelyLock(Boolean canRemotelyLock); + + _FinalStage canProgramOfflineAccessCodes(Optional canProgramOfflineAccessCodes); + + _FinalStage canProgramOfflineAccessCodes(Boolean canProgramOfflineAccessCodes); + + _FinalStage canProgramOnlineAccessCodes(Optional canProgramOnlineAccessCodes); + + _FinalStage canProgramOnlineAccessCodes(Boolean canProgramOnlineAccessCodes); + + _FinalStage canSimulateRemoval(Optional canSimulateRemoval); + + _FinalStage canSimulateRemoval(Boolean canSimulateRemoval); + + _FinalStage canSimulateConnection(Optional canSimulateConnection); + + _FinalStage canSimulateConnection(Boolean canSimulateConnection); + + _FinalStage canSimulateDisconnection(Optional canSimulateDisconnection); + + _FinalStage canSimulateDisconnection(Boolean canSimulateDisconnection); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DeviceIdStage, + DeviceTypeStage, + DisplayNameStage, + PropertiesStage, + WorkspaceIdStage, + CreatedAtStage, + IsManagedStage, + _FinalStage { + private String deviceId; + + private PhoneDeviceType deviceType; + + private String displayName; + + private PhoneProperties properties; + + private String workspaceId; + + private OffsetDateTime createdAt; + + private boolean isManaged; + + private Optional canSimulateDisconnection = Optional.empty(); + + private Optional canSimulateConnection = Optional.empty(); + + private Optional canSimulateRemoval = Optional.empty(); + + private Optional canProgramOnlineAccessCodes = Optional.empty(); + + private Optional canProgramOfflineAccessCodes = Optional.empty(); + + private Optional canRemotelyLock = Optional.empty(); + + private Optional canRemotelyUnlock = Optional.empty(); + + private Map customMetadata = new LinkedHashMap<>(); + + private List warnings = new ArrayList<>(); + + private List errors = new ArrayList<>(); + + private Optional location = Optional.empty(); + + private List capabilitiesSupported = new ArrayList<>(); + + private Optional nickname = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Phone other) { + deviceId(other.getDeviceId()); + deviceType(other.getDeviceType()); + nickname(other.getNickname()); + displayName(other.getDisplayName()); + capabilitiesSupported(other.getCapabilitiesSupported()); + properties(other.getProperties()); + location(other.getLocation()); + workspaceId(other.getWorkspaceId()); + errors(other.getErrors()); + warnings(other.getWarnings()); + createdAt(other.getCreatedAt()); + isManaged(other.getIsManaged()); + customMetadata(other.getCustomMetadata()); + canRemotelyUnlock(other.getCanRemotelyUnlock()); + canRemotelyLock(other.getCanRemotelyLock()); + canProgramOfflineAccessCodes(other.getCanProgramOfflineAccessCodes()); + canProgramOnlineAccessCodes(other.getCanProgramOnlineAccessCodes()); + canSimulateRemoval(other.getCanSimulateRemoval()); + canSimulateConnection(other.getCanSimulateConnection()); + canSimulateDisconnection(other.getCanSimulateDisconnection()); + return this; + } + + /** + *

Unique identifier for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("device_id") + public DeviceTypeStage deviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + @java.lang.Override + @JsonSetter("device_type") + public DisplayNameStage deviceType(PhoneDeviceType deviceType) { + this.deviceType = deviceType; + return this; + } + + /** + *

Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("display_name") + public PropertiesStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + @JsonSetter("properties") + public WorkspaceIdStage properties(PhoneProperties properties) { + this.properties = properties; + return this; + } + + /** + *

Unique identifier for the Seam workspace associated with the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("workspace_id") + public CreatedAtStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + *

Date and time at which the device object was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public IsManagedStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

Indicates whether Seam manages the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_managed") + public _FinalStage isManaged(boolean isManaged) { + this.isManaged = isManaged; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateDisconnection(Boolean canSimulateDisconnection) { + this.canSimulateDisconnection = Optional.of(canSimulateDisconnection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_disconnection", nulls = Nulls.SKIP) + public _FinalStage canSimulateDisconnection(Optional canSimulateDisconnection) { + this.canSimulateDisconnection = canSimulateDisconnection; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateConnection(Boolean canSimulateConnection) { + this.canSimulateConnection = Optional.of(canSimulateConnection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_connection", nulls = Nulls.SKIP) + public _FinalStage canSimulateConnection(Optional canSimulateConnection) { + this.canSimulateConnection = canSimulateConnection; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateRemoval(Boolean canSimulateRemoval) { + this.canSimulateRemoval = Optional.of(canSimulateRemoval); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_removal", nulls = Nulls.SKIP) + public _FinalStage canSimulateRemoval(Optional canSimulateRemoval) { + this.canSimulateRemoval = canSimulateRemoval; + return this; + } + + @java.lang.Override + public _FinalStage canProgramOnlineAccessCodes(Boolean canProgramOnlineAccessCodes) { + this.canProgramOnlineAccessCodes = Optional.of(canProgramOnlineAccessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_program_online_access_codes", nulls = Nulls.SKIP) + public _FinalStage canProgramOnlineAccessCodes(Optional canProgramOnlineAccessCodes) { + this.canProgramOnlineAccessCodes = canProgramOnlineAccessCodes; + return this; + } + + @java.lang.Override + public _FinalStage canProgramOfflineAccessCodes(Boolean canProgramOfflineAccessCodes) { + this.canProgramOfflineAccessCodes = Optional.of(canProgramOfflineAccessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_program_offline_access_codes", nulls = Nulls.SKIP) + public _FinalStage canProgramOfflineAccessCodes(Optional canProgramOfflineAccessCodes) { + this.canProgramOfflineAccessCodes = canProgramOfflineAccessCodes; + return this; + } + + @java.lang.Override + public _FinalStage canRemotelyLock(Boolean canRemotelyLock) { + this.canRemotelyLock = Optional.of(canRemotelyLock); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_remotely_lock", nulls = Nulls.SKIP) + public _FinalStage canRemotelyLock(Optional canRemotelyLock) { + this.canRemotelyLock = canRemotelyLock; + return this; + } + + @java.lang.Override + public _FinalStage canRemotelyUnlock(Boolean canRemotelyUnlock) { + this.canRemotelyUnlock = Optional.of(canRemotelyUnlock); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_remotely_unlock", nulls = Nulls.SKIP) + public _FinalStage canRemotelyUnlock(Optional canRemotelyUnlock) { + this.canRemotelyUnlock = canRemotelyUnlock; + return this; + } + + @java.lang.Override + public _FinalStage customMetadata(String key, PhoneCustomMetadataValue value) { + this.customMetadata.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllCustomMetadata(Map customMetadata) { + this.customMetadata.putAll(customMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_metadata", nulls = Nulls.SKIP) + public _FinalStage customMetadata(Map customMetadata) { + this.customMetadata.clear(); + this.customMetadata.putAll(customMetadata); + return this; + } + + /** + *

Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + /** + *

Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addWarnings(PhoneWarningsItem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + /** + *

Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + /** + *

Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addErrors(PhoneErrorsItem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + /** + *

Location information for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage location(PhoneLocation location) { + this.location = Optional.of(location); + return this; + } + + @java.lang.Override + @JsonSetter(value = "location", nulls = Nulls.SKIP) + public _FinalStage location(Optional location) { + this.location = location; + return this; + } + + /** + *

Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCapabilitiesSupported(List capabilitiesSupported) { + this.capabilitiesSupported.addAll(capabilitiesSupported); + return this; + } + + /** + *

Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCapabilitiesSupported(PhoneCapabilitiesSupportedItem capabilitiesSupported) { + this.capabilitiesSupported.add(capabilitiesSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "capabilities_supported", nulls = Nulls.SKIP) + public _FinalStage capabilitiesSupported(List capabilitiesSupported) { + this.capabilitiesSupported.clear(); + this.capabilitiesSupported.addAll(capabilitiesSupported); + return this; + } + + /** + *

Optional nickname to describe the device, settable through Seam

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage nickname(String nickname) { + this.nickname = Optional.of(nickname); + return this; + } + + @java.lang.Override + @JsonSetter(value = "nickname", nulls = Nulls.SKIP) + public _FinalStage nickname(Optional nickname) { + this.nickname = nickname; + return this; + } + + @java.lang.Override + public Phone build() { + return new Phone( + deviceId, + deviceType, + nickname, + displayName, + capabilitiesSupported, + properties, + location, + workspaceId, + errors, + warnings, + createdAt, + isManaged, + customMetadata, + canRemotelyUnlock, + canRemotelyLock, + canProgramOfflineAccessCodes, + canProgramOnlineAccessCodes, + canSimulateRemoval, + canSimulateConnection, + canSimulateDisconnection, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/SupportedCapabililty.java b/src/main/java/com/seam/api/types/PhoneCapabilitiesSupportedItem.java similarity index 72% rename from src/main/java/com/seam/api/types/SupportedCapabililty.java rename to src/main/java/com/seam/api/types/PhoneCapabilitiesSupportedItem.java index 0a55617..478d956 100644 --- a/src/main/java/com/seam/api/types/SupportedCapabililty.java +++ b/src/main/java/com/seam/api/types/PhoneCapabilitiesSupportedItem.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum SupportedCapabililty { +public enum PhoneCapabilitiesSupportedItem { ACCESS_CODE("access_code"), LOCK("lock"), @@ -14,16 +14,18 @@ public enum SupportedCapabililty { THERMOSTAT("thermostat"), - BATTERY("battery"); + BATTERY("battery"), + + PHONE("phone"); private final String value; - SupportedCapabililty(String value) { + PhoneCapabilitiesSupportedItem(String value) { this.value = value; } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/PhoneCustomMetadataValue.java b/src/main/java/com/seam/api/types/PhoneCustomMetadataValue.java new file mode 100644 index 0000000..26fc1ab --- /dev/null +++ b/src/main/java/com/seam/api/types/PhoneCustomMetadataValue.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.seam.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PhoneCustomMetadataValue.Deserializer.class) +public final class PhoneCustomMetadataValue { + private final Object value; + + private final int type; + + private PhoneCustomMetadataValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneCustomMetadataValue && equalTo((PhoneCustomMetadataValue) other); + } + + private boolean equalTo(PhoneCustomMetadataValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PhoneCustomMetadataValue of(String value) { + return new PhoneCustomMetadataValue(value, 0); + } + + public static PhoneCustomMetadataValue of(boolean value) { + return new PhoneCustomMetadataValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PhoneCustomMetadataValue.class); + } + + @java.lang.Override + public PhoneCustomMetadataValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/seam/api/types/PhoneDeviceType.java b/src/main/java/com/seam/api/types/PhoneDeviceType.java new file mode 100644 index 0000000..11a4329 --- /dev/null +++ b/src/main/java/com/seam/api/types/PhoneDeviceType.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PhoneDeviceType { + ANDROID_PHONE("android_phone"), + + IOS_PHONE("ios_phone"); + + private final String value; + + PhoneDeviceType(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/PhoneErrorsItem.java b/src/main/java/com/seam/api/types/PhoneErrorsItem.java new file mode 100644 index 0000000..42d1965 --- /dev/null +++ b/src/main/java/com/seam/api/types/PhoneErrorsItem.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhoneErrorsItem.Builder.class) +public final class PhoneErrorsItem { + private final String errorCode; + + private final String message; + + private final Map additionalProperties; + + private PhoneErrorsItem(String errorCode, String message, Map additionalProperties) { + this.errorCode = errorCode; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("error_code") + public String getErrorCode() { + return errorCode; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneErrorsItem && equalTo((PhoneErrorsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneErrorsItem other) { + return errorCode.equals(other.errorCode) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.errorCode, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorCodeStage builder() { + return new Builder(); + } + + public interface ErrorCodeStage { + MessageStage errorCode(String errorCode); + + Builder from(PhoneErrorsItem other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + PhoneErrorsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorCodeStage, MessageStage, _FinalStage { + private String errorCode; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhoneErrorsItem other) { + errorCode(other.getErrorCode()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("error_code") + public MessageStage errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public PhoneErrorsItem build() { + return new PhoneErrorsItem(errorCode, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/PhoneLocation.java b/src/main/java/com/seam/api/types/PhoneLocation.java new file mode 100644 index 0000000..879ac0d --- /dev/null +++ b/src/main/java/com/seam/api/types/PhoneLocation.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhoneLocation.Builder.class) +public final class PhoneLocation { + private final Optional locationName; + + private final Optional timezone; + + private final Map additionalProperties; + + private PhoneLocation( + Optional locationName, Optional timezone, Map additionalProperties) { + this.locationName = locationName; + this.timezone = timezone; + this.additionalProperties = additionalProperties; + } + + /** + * @return Name of the device location. + */ + @JsonProperty("location_name") + public Optional getLocationName() { + return locationName; + } + + /** + * @return Time zone of the device location. + */ + @JsonProperty("timezone") + public Optional getTimezone() { + return timezone; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneLocation && equalTo((PhoneLocation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneLocation other) { + return locationName.equals(other.locationName) && timezone.equals(other.timezone); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.locationName, this.timezone); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional locationName = Optional.empty(); + + private Optional timezone = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneLocation other) { + locationName(other.getLocationName()); + timezone(other.getTimezone()); + return this; + } + + @JsonSetter(value = "location_name", nulls = Nulls.SKIP) + public Builder locationName(Optional locationName) { + this.locationName = locationName; + return this; + } + + public Builder locationName(String locationName) { + this.locationName = Optional.of(locationName); + return this; + } + + @JsonSetter(value = "timezone", nulls = Nulls.SKIP) + public Builder timezone(Optional timezone) { + this.timezone = timezone; + return this; + } + + public Builder timezone(String timezone) { + this.timezone = Optional.of(timezone); + return this; + } + + public PhoneLocation build() { + return new PhoneLocation(locationName, timezone, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/PhoneOperatingSystem.java b/src/main/java/com/seam/api/types/PhoneOperatingSystem.java new file mode 100644 index 0000000..6d559b5 --- /dev/null +++ b/src/main/java/com/seam/api/types/PhoneOperatingSystem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PhoneOperatingSystem { + ANDROID("android"), + + IOS("ios"); + + private final String value; + + PhoneOperatingSystem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/PhoneProperties.java b/src/main/java/com/seam/api/types/PhoneProperties.java new file mode 100644 index 0000000..a89e09d --- /dev/null +++ b/src/main/java/com/seam/api/types/PhoneProperties.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhoneProperties.Builder.class) +public final class PhoneProperties { + private final Optional assaAbloyCredentialServiceMetadata; + + private final Map additionalProperties; + + private PhoneProperties( + Optional assaAbloyCredentialServiceMetadata, + Map additionalProperties) { + this.assaAbloyCredentialServiceMetadata = assaAbloyCredentialServiceMetadata; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("assa_abloy_credential_service_metadata") + public Optional getAssaAbloyCredentialServiceMetadata() { + return assaAbloyCredentialServiceMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneProperties && equalTo((PhoneProperties) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneProperties other) { + return assaAbloyCredentialServiceMetadata.equals(other.assaAbloyCredentialServiceMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.assaAbloyCredentialServiceMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional assaAbloyCredentialServiceMetadata = + Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneProperties other) { + assaAbloyCredentialServiceMetadata(other.getAssaAbloyCredentialServiceMetadata()); + return this; + } + + @JsonSetter(value = "assa_abloy_credential_service_metadata", nulls = Nulls.SKIP) + public Builder assaAbloyCredentialServiceMetadata( + Optional assaAbloyCredentialServiceMetadata) { + this.assaAbloyCredentialServiceMetadata = assaAbloyCredentialServiceMetadata; + return this; + } + + public Builder assaAbloyCredentialServiceMetadata( + PhonePropertiesAssaAbloyCredentialServiceMetadata assaAbloyCredentialServiceMetadata) { + this.assaAbloyCredentialServiceMetadata = Optional.of(assaAbloyCredentialServiceMetadata); + return this; + } + + public PhoneProperties build() { + return new PhoneProperties(assaAbloyCredentialServiceMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadata.java b/src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadata.java new file mode 100644 index 0000000..c462d1c --- /dev/null +++ b/src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadata.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhonePropertiesAssaAbloyCredentialServiceMetadata.Builder.class) +public final class PhonePropertiesAssaAbloyCredentialServiceMetadata { + private final boolean hasActiveEndpoint; + + private final List endpoints; + + private final Map additionalProperties; + + private PhonePropertiesAssaAbloyCredentialServiceMetadata( + boolean hasActiveEndpoint, + List endpoints, + Map additionalProperties) { + this.hasActiveEndpoint = hasActiveEndpoint; + this.endpoints = endpoints; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("has_active_endpoint") + public boolean getHasActiveEndpoint() { + return hasActiveEndpoint; + } + + @JsonProperty("endpoints") + public List getEndpoints() { + return endpoints; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhonePropertiesAssaAbloyCredentialServiceMetadata + && equalTo((PhonePropertiesAssaAbloyCredentialServiceMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhonePropertiesAssaAbloyCredentialServiceMetadata other) { + return hasActiveEndpoint == other.hasActiveEndpoint && endpoints.equals(other.endpoints); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hasActiveEndpoint, this.endpoints); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasActiveEndpointStage builder() { + return new Builder(); + } + + public interface HasActiveEndpointStage { + _FinalStage hasActiveEndpoint(boolean hasActiveEndpoint); + + Builder from(PhonePropertiesAssaAbloyCredentialServiceMetadata other); + } + + public interface _FinalStage { + PhonePropertiesAssaAbloyCredentialServiceMetadata build(); + + _FinalStage endpoints(List endpoints); + + _FinalStage addEndpoints(PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem endpoints); + + _FinalStage addAllEndpoints(List endpoints); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HasActiveEndpointStage, _FinalStage { + private boolean hasActiveEndpoint; + + private List endpoints = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhonePropertiesAssaAbloyCredentialServiceMetadata other) { + hasActiveEndpoint(other.getHasActiveEndpoint()); + endpoints(other.getEndpoints()); + return this; + } + + @java.lang.Override + @JsonSetter("has_active_endpoint") + public _FinalStage hasActiveEndpoint(boolean hasActiveEndpoint) { + this.hasActiveEndpoint = hasActiveEndpoint; + return this; + } + + @java.lang.Override + public _FinalStage addAllEndpoints( + List endpoints) { + this.endpoints.addAll(endpoints); + return this; + } + + @java.lang.Override + public _FinalStage addEndpoints(PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem endpoints) { + this.endpoints.add(endpoints); + return this; + } + + @java.lang.Override + @JsonSetter(value = "endpoints", nulls = Nulls.SKIP) + public _FinalStage endpoints(List endpoints) { + this.endpoints.clear(); + this.endpoints.addAll(endpoints); + return this; + } + + @java.lang.Override + public PhonePropertiesAssaAbloyCredentialServiceMetadata build() { + return new PhonePropertiesAssaAbloyCredentialServiceMetadata( + hasActiveEndpoint, endpoints, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java b/src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java new file mode 100644 index 0000000..c4190c2 --- /dev/null +++ b/src/main/java/com/seam/api/types/PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem.Builder.class) +public final class PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem { + private final String endpointId; + + private final boolean isActive; + + private final Map additionalProperties; + + private PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem( + String endpointId, boolean isActive, Map additionalProperties) { + this.endpointId = endpointId; + this.isActive = isActive; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("endpoint_id") + public String getEndpointId() { + return endpointId; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem + && equalTo((PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem other) { + return endpointId.equals(other.endpointId) && isActive == other.isActive; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.endpointId, this.isActive); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndpointIdStage builder() { + return new Builder(); + } + + public interface EndpointIdStage { + IsActiveStage endpointId(String endpointId); + + Builder from(PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EndpointIdStage, IsActiveStage, _FinalStage { + private String endpointId; + + private boolean isActive; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem other) { + endpointId(other.getEndpointId()); + isActive(other.getIsActive()); + return this; + } + + @java.lang.Override + @JsonSetter("endpoint_id") + public IsActiveStage endpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem build() { + return new PhonePropertiesAssaAbloyCredentialServiceMetadataEndpointsItem( + endpointId, isActive, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/PhoneWarningsItem.java b/src/main/java/com/seam/api/types/PhoneWarningsItem.java new file mode 100644 index 0000000..17d0f20 --- /dev/null +++ b/src/main/java/com/seam/api/types/PhoneWarningsItem.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = PhoneWarningsItem.Builder.class) +public final class PhoneWarningsItem { + private final String warningCode; + + private final String message; + + private final Map additionalProperties; + + private PhoneWarningsItem(String warningCode, String message, Map additionalProperties) { + this.warningCode = warningCode; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("warning_code") + public String getWarningCode() { + return warningCode; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneWarningsItem && equalTo((PhoneWarningsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneWarningsItem other) { + return warningCode.equals(other.warningCode) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.warningCode, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static WarningCodeStage builder() { + return new Builder(); + } + + public interface WarningCodeStage { + MessageStage warningCode(String warningCode); + + Builder from(PhoneWarningsItem other); + } + + public interface MessageStage { + _FinalStage message(String message); + } + + public interface _FinalStage { + PhoneWarningsItem build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements WarningCodeStage, MessageStage, _FinalStage { + private String warningCode; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PhoneWarningsItem other) { + warningCode(other.getWarningCode()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("warning_code") + public MessageStage warningCode(String warningCode) { + this.warningCode = warningCode; + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(String message) { + this.message = message; + return this; + } + + @java.lang.Override + public PhoneWarningsItem build() { + return new PhoneWarningsItem(warningCode, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/ProviderCategory.java b/src/main/java/com/seam/api/types/ProviderCategory.java index da6c5f8..5c14415 100644 --- a/src/main/java/com/seam/api/types/ProviderCategory.java +++ b/src/main/java/com/seam/api/types/ProviderCategory.java @@ -8,9 +8,7 @@ public enum ProviderCategory { STABLE("stable"), - CONSUMER_SMARTLOCKS("consumer_smartlocks"), - - INTERNAL_BETA("internal_beta"); + CONSUMER_SMARTLOCKS("consumer_smartlocks"); private final String value; @@ -19,7 +17,7 @@ public enum ProviderCategory { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/SelectionMode.java b/src/main/java/com/seam/api/types/SelectionMode.java index 1a5a733..0860a18 100644 --- a/src/main/java/com/seam/api/types/SelectionMode.java +++ b/src/main/java/com/seam/api/types/SelectionMode.java @@ -19,7 +19,7 @@ public enum SelectionMode { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/ServiceByServiceNameResponse.java b/src/main/java/com/seam/api/types/ServiceByServiceNameResponse.java deleted file mode 100644 index 9cf2ffe..0000000 --- a/src/main/java/com/seam/api/types/ServiceByServiceNameResponse.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = ServiceByServiceNameResponse.Builder.class) -public final class ServiceByServiceNameResponse { - private final boolean ok; - - private final String lastServiceEvaluationAt; - - private final ServiceHealth serviceHealth; - - private final Map additionalProperties; - - private ServiceByServiceNameResponse( - boolean ok, - String lastServiceEvaluationAt, - ServiceHealth serviceHealth, - Map additionalProperties) { - this.ok = ok; - this.lastServiceEvaluationAt = lastServiceEvaluationAt; - this.serviceHealth = serviceHealth; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("ok") - public boolean getOk() { - return ok; - } - - @JsonProperty("last_service_evaluation_at") - public String getLastServiceEvaluationAt() { - return lastServiceEvaluationAt; - } - - @JsonProperty("service_health") - public ServiceHealth getServiceHealth() { - return serviceHealth; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ServiceByServiceNameResponse && equalTo((ServiceByServiceNameResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ServiceByServiceNameResponse other) { - return ok == other.ok - && lastServiceEvaluationAt.equals(other.lastServiceEvaluationAt) - && serviceHealth.equals(other.serviceHealth); - } - - @Override - public int hashCode() { - return Objects.hash(this.ok, this.lastServiceEvaluationAt, this.serviceHealth); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static OkStage builder() { - return new Builder(); - } - - public interface OkStage { - LastServiceEvaluationAtStage ok(boolean ok); - - Builder from(ServiceByServiceNameResponse other); - } - - public interface LastServiceEvaluationAtStage { - ServiceHealthStage lastServiceEvaluationAt(String lastServiceEvaluationAt); - } - - public interface ServiceHealthStage { - _FinalStage serviceHealth(ServiceHealth serviceHealth); - } - - public interface _FinalStage { - ServiceByServiceNameResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements OkStage, LastServiceEvaluationAtStage, ServiceHealthStage, _FinalStage { - private boolean ok; - - private String lastServiceEvaluationAt; - - private ServiceHealth serviceHealth; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(ServiceByServiceNameResponse other) { - ok(other.getOk()); - lastServiceEvaluationAt(other.getLastServiceEvaluationAt()); - serviceHealth(other.getServiceHealth()); - return this; - } - - @Override - @JsonSetter("ok") - public LastServiceEvaluationAtStage ok(boolean ok) { - this.ok = ok; - return this; - } - - @Override - @JsonSetter("last_service_evaluation_at") - public ServiceHealthStage lastServiceEvaluationAt(String lastServiceEvaluationAt) { - this.lastServiceEvaluationAt = lastServiceEvaluationAt; - return this; - } - - @Override - @JsonSetter("service_health") - public _FinalStage serviceHealth(ServiceHealth serviceHealth) { - this.serviceHealth = serviceHealth; - return this; - } - - @Override - public ServiceByServiceNameResponse build() { - return new ServiceByServiceNameResponse(ok, lastServiceEvaluationAt, serviceHealth, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/types/ServiceHealth.java b/src/main/java/com/seam/api/types/ServiceHealth.java index 22eeb05..862796c 100644 --- a/src/main/java/com/seam/api/types/ServiceHealth.java +++ b/src/main/java/com/seam/api/types/ServiceHealth.java @@ -49,7 +49,7 @@ public String getDescription() { return description; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ServiceHealth && equalTo((ServiceHealth) other); @@ -64,12 +64,12 @@ private boolean equalTo(ServiceHealth other) { return service.equals(other.service) && status.equals(other.status) && description.equals(other.description); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.service, this.status, this.description); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -109,7 +109,7 @@ public static final class Builder implements ServiceStage, StatusStage, Descript private Builder() {} - @Override + @java.lang.Override public Builder from(ServiceHealth other) { service(other.getService()); status(other.getStatus()); @@ -117,28 +117,28 @@ public Builder from(ServiceHealth other) { return this; } - @Override + @java.lang.Override @JsonSetter("service") public StatusStage service(String service) { this.service = service; return this; } - @Override + @java.lang.Override @JsonSetter("status") public DescriptionStage status(ServiceHealthStatus status) { this.status = status; return this; } - @Override + @java.lang.Override @JsonSetter("description") public _FinalStage description(String description) { this.description = description; return this; } - @Override + @java.lang.Override public ServiceHealth build() { return new ServiceHealth(service, status, description, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/ServiceHealthStatus.java b/src/main/java/com/seam/api/types/ServiceHealthStatus.java index f43564e..c4af7fe 100644 --- a/src/main/java/com/seam/api/types/ServiceHealthStatus.java +++ b/src/main/java/com/seam/api/types/ServiceHealthStatus.java @@ -19,7 +19,7 @@ public enum ServiceHealthStatus { } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCode.java b/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCode.java deleted file mode 100644 index c11cf9a..0000000 --- a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCode.java +++ /dev/null @@ -1,202 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; -import java.util.Optional; - -public final class SimulateCreateUnmanagedAccessCodeResponseAccessCode { - private final Value value; - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private SimulateCreateUnmanagedAccessCodeResponseAccessCode(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static SimulateCreateUnmanagedAccessCodeResponseAccessCode ongoing( - SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing value) { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCode(new OngoingValue(value)); - } - - public static SimulateCreateUnmanagedAccessCodeResponseAccessCode timeBound( - SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound value) { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCode(new TimeBoundValue(value)); - } - - public boolean isOngoing() { - return value instanceof OngoingValue; - } - - public boolean isTimeBound() { - return value instanceof TimeBoundValue; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getOngoing() { - if (isOngoing()) { - return Optional.of(((OngoingValue) value).value); - } - return Optional.empty(); - } - - public Optional getTimeBound() { - if (isTimeBound()) { - return Optional.of(((TimeBoundValue) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitOngoing(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing ongoing); - - T visitTimeBound(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound timeBound); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(OngoingValue.class), @JsonSubTypes.Type(TimeBoundValue.class)}) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("ongoing") - private static final class OngoingValue implements Value { - @JsonUnwrapped - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private OngoingValue() {} - - private OngoingValue(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing value) { - this.value = value; - } - - @Override - public T visit(Visitor visitor) { - return visitor.visitOngoing(value); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof OngoingValue && equalTo((OngoingValue) other); - } - - private boolean equalTo(OngoingValue other) { - return value.equals(other.value); - } - - @Override - public int hashCode() { - return Objects.hash(this.value); - } - - @Override - public String toString() { - return "SimulateCreateUnmanagedAccessCodeResponseAccessCode{" + "value: " + value + "}"; - } - } - - @JsonTypeName("time_bound") - private static final class TimeBoundValue implements Value { - @JsonUnwrapped - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private TimeBoundValue() {} - - private TimeBoundValue(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound value) { - this.value = value; - } - - @Override - public T visit(Visitor visitor) { - return visitor.visitTimeBound(value); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeBoundValue && equalTo((TimeBoundValue) other); - } - - private boolean equalTo(TimeBoundValue other) { - return value.equals(other.value); - } - - @Override - public int hashCode() { - return Objects.hash(this.value); - } - - @Override - public String toString() { - return "SimulateCreateUnmanagedAccessCodeResponseAccessCode{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @Override - public String toString() { - return "SimulateCreateUnmanagedAccessCodeResponseAccessCode{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing.java b/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing.java deleted file mode 100644 index 6fc44a7..0000000 --- a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing.java +++ /dev/null @@ -1,250 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing.Builder.class) -public final class SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing { - private final String accessCodeId; - - private final Optional code; - - private final SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt createdAt; - - private final boolean isManaged; - - private final Optional startsAt; - - private final Optional endsAt; - - private final Map additionalProperties; - - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing( - String accessCodeId, - Optional code, - SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt createdAt, - boolean isManaged, - Optional startsAt, - Optional endsAt, - Map additionalProperties) { - this.accessCodeId = accessCodeId; - this.code = code; - this.createdAt = createdAt; - this.isManaged = isManaged; - this.startsAt = startsAt; - this.endsAt = endsAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("access_code_id") - public String getAccessCodeId() { - return accessCodeId; - } - - @JsonProperty("code") - public Optional getCode() { - return code; - } - - @JsonProperty("status") - public String getStatus() { - return "set"; - } - - @JsonProperty("created_at") - public SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt getCreatedAt() { - return createdAt; - } - - @JsonProperty("is_managed") - public boolean getIsManaged() { - return isManaged; - } - - @JsonProperty("starts_at") - public Optional getStartsAt() { - return startsAt; - } - - @JsonProperty("ends_at") - public Optional getEndsAt() { - return endsAt; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing - && equalTo((SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing other) { - return accessCodeId.equals(other.accessCodeId) - && code.equals(other.code) - && createdAt.equals(other.createdAt) - && isManaged == other.isManaged - && startsAt.equals(other.startsAt) - && endsAt.equals(other.endsAt); - } - - @Override - public int hashCode() { - return Objects.hash(this.accessCodeId, this.code, this.createdAt, this.isManaged, this.startsAt, this.endsAt); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccessCodeIdStage builder() { - return new Builder(); - } - - public interface AccessCodeIdStage { - CreatedAtStage accessCodeId(String accessCodeId); - - Builder from(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing other); - } - - public interface CreatedAtStage { - IsManagedStage createdAt(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt createdAt); - } - - public interface IsManagedStage { - _FinalStage isManaged(boolean isManaged); - } - - public interface _FinalStage { - SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing build(); - - _FinalStage code(Optional code); - - _FinalStage code(String code); - - _FinalStage startsAt(Optional startsAt); - - _FinalStage startsAt(String startsAt); - - _FinalStage endsAt(Optional endsAt); - - _FinalStage endsAt(String endsAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccessCodeIdStage, CreatedAtStage, IsManagedStage, _FinalStage { - private String accessCodeId; - - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt createdAt; - - private boolean isManaged; - - private Optional endsAt = Optional.empty(); - - private Optional startsAt = Optional.empty(); - - private Optional code = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing other) { - accessCodeId(other.getAccessCodeId()); - code(other.getCode()); - createdAt(other.getCreatedAt()); - isManaged(other.getIsManaged()); - startsAt(other.getStartsAt()); - endsAt(other.getEndsAt()); - return this; - } - - @Override - @JsonSetter("access_code_id") - public CreatedAtStage accessCodeId(String accessCodeId) { - this.accessCodeId = accessCodeId; - return this; - } - - @Override - @JsonSetter("created_at") - public IsManagedStage createdAt(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt createdAt) { - this.createdAt = createdAt; - return this; - } - - @Override - @JsonSetter("is_managed") - public _FinalStage isManaged(boolean isManaged) { - this.isManaged = isManaged; - return this; - } - - @Override - public _FinalStage endsAt(String endsAt) { - this.endsAt = Optional.of(endsAt); - return this; - } - - @Override - @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) - public _FinalStage endsAt(Optional endsAt) { - this.endsAt = endsAt; - return this; - } - - @Override - public _FinalStage startsAt(String startsAt) { - this.startsAt = Optional.of(startsAt); - return this; - } - - @Override - @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) - public _FinalStage startsAt(Optional startsAt) { - this.startsAt = startsAt; - return this; - } - - @Override - public _FinalStage code(String code) { - this.code = Optional.of(code); - return this; - } - - @Override - @JsonSetter(value = "code", nulls = Nulls.SKIP) - public _FinalStage code(Optional code) { - this.code = code; - return this; - } - - @Override - public SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing build() { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoing( - accessCodeId, code, createdAt, isManaged, startsAt, endsAt, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt.java b/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt.java deleted file mode 100644 index f898b7b..0000000 --- a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seam.api.core.ObjectMappers; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Objects; - -@JsonDeserialize(using = SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt.Deserializer.class) -public final class SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt { - private final Object value; - - private final int type; - - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((OffsetDateTime) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt - && equalTo((SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt) other); - } - - private boolean equalTo(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt other) { - return value.equals(other.value); - } - - @Override - public int hashCode() { - return Objects.hash(this.value); - } - - @Override - public String toString() { - return this.value.toString(); - } - - public static SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt of(String value) { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt(value, 0); - } - - public static SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt of(OffsetDateTime value) { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(OffsetDateTime value); - } - - static final class Deserializer - extends StdDeserializer { - Deserializer() { - super(SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt.class); - } - - @Override - public SimulateCreateUnmanagedAccessCodeResponseAccessCodeOngoingCreatedAt deserialize( - JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, OffsetDateTime.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound.java b/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound.java deleted file mode 100644 index 26bb585..0000000 --- a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound.Builder.class) -public final class SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound { - private final String accessCodeId; - - private final Optional code; - - private final SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt createdAt; - - private final boolean isManaged; - - private final Optional startsAt; - - private final Optional endsAt; - - private final Map additionalProperties; - - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound( - String accessCodeId, - Optional code, - SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt createdAt, - boolean isManaged, - Optional startsAt, - Optional endsAt, - Map additionalProperties) { - this.accessCodeId = accessCodeId; - this.code = code; - this.createdAt = createdAt; - this.isManaged = isManaged; - this.startsAt = startsAt; - this.endsAt = endsAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("access_code_id") - public String getAccessCodeId() { - return accessCodeId; - } - - @JsonProperty("code") - public Optional getCode() { - return code; - } - - @JsonProperty("status") - public String getStatus() { - return "set"; - } - - @JsonProperty("created_at") - public SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt getCreatedAt() { - return createdAt; - } - - @JsonProperty("is_managed") - public boolean getIsManaged() { - return isManaged; - } - - @JsonProperty("starts_at") - public Optional getStartsAt() { - return startsAt; - } - - @JsonProperty("ends_at") - public Optional getEndsAt() { - return endsAt; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound - && equalTo((SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound other) { - return accessCodeId.equals(other.accessCodeId) - && code.equals(other.code) - && createdAt.equals(other.createdAt) - && isManaged == other.isManaged - && startsAt.equals(other.startsAt) - && endsAt.equals(other.endsAt); - } - - @Override - public int hashCode() { - return Objects.hash(this.accessCodeId, this.code, this.createdAt, this.isManaged, this.startsAt, this.endsAt); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccessCodeIdStage builder() { - return new Builder(); - } - - public interface AccessCodeIdStage { - CreatedAtStage accessCodeId(String accessCodeId); - - Builder from(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound other); - } - - public interface CreatedAtStage { - IsManagedStage createdAt(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt createdAt); - } - - public interface IsManagedStage { - _FinalStage isManaged(boolean isManaged); - } - - public interface _FinalStage { - SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound build(); - - _FinalStage code(Optional code); - - _FinalStage code(String code); - - _FinalStage startsAt(Optional startsAt); - - _FinalStage startsAt(String startsAt); - - _FinalStage endsAt(Optional endsAt); - - _FinalStage endsAt(String endsAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccessCodeIdStage, CreatedAtStage, IsManagedStage, _FinalStage { - private String accessCodeId; - - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt createdAt; - - private boolean isManaged; - - private Optional endsAt = Optional.empty(); - - private Optional startsAt = Optional.empty(); - - private Optional code = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound other) { - accessCodeId(other.getAccessCodeId()); - code(other.getCode()); - createdAt(other.getCreatedAt()); - isManaged(other.getIsManaged()); - startsAt(other.getStartsAt()); - endsAt(other.getEndsAt()); - return this; - } - - @Override - @JsonSetter("access_code_id") - public CreatedAtStage accessCodeId(String accessCodeId) { - this.accessCodeId = accessCodeId; - return this; - } - - @Override - @JsonSetter("created_at") - public IsManagedStage createdAt( - SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt createdAt) { - this.createdAt = createdAt; - return this; - } - - @Override - @JsonSetter("is_managed") - public _FinalStage isManaged(boolean isManaged) { - this.isManaged = isManaged; - return this; - } - - @Override - public _FinalStage endsAt(String endsAt) { - this.endsAt = Optional.of(endsAt); - return this; - } - - @Override - @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) - public _FinalStage endsAt(Optional endsAt) { - this.endsAt = endsAt; - return this; - } - - @Override - public _FinalStage startsAt(String startsAt) { - this.startsAt = Optional.of(startsAt); - return this; - } - - @Override - @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) - public _FinalStage startsAt(Optional startsAt) { - this.startsAt = startsAt; - return this; - } - - @Override - public _FinalStage code(String code) { - this.code = Optional.of(code); - return this; - } - - @Override - @JsonSetter(value = "code", nulls = Nulls.SKIP) - public _FinalStage code(Optional code) { - this.code = code; - return this; - } - - @Override - public SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound build() { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBound( - accessCodeId, code, createdAt, isManaged, startsAt, endsAt, additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt.java b/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt.java deleted file mode 100644 index d99cae4..0000000 --- a/src/main/java/com/seam/api/types/SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seam.api.core.ObjectMappers; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Objects; - -@JsonDeserialize(using = SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt.Deserializer.class) -public final class SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt { - private final Object value; - - private final int type; - - private SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((OffsetDateTime) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt - && equalTo((SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt) other); - } - - private boolean equalTo(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt other) { - return value.equals(other.value); - } - - @Override - public int hashCode() { - return Objects.hash(this.value); - } - - @Override - public String toString() { - return this.value.toString(); - } - - public static SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt of(String value) { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt(value, 0); - } - - public static SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt of(OffsetDateTime value) { - return new SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(OffsetDateTime value); - } - - static final class Deserializer - extends StdDeserializer { - Deserializer() { - super(SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt.class); - } - - @Override - public SimulateCreateUnmanagedAccessCodeResponseAccessCodeTimeBoundCreatedAt deserialize( - JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, OffsetDateTime.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/seam/api/types/UnmanagedGetResponseAccessCode.java b/src/main/java/com/seam/api/types/UnmanagedAccessCode.java similarity index 70% rename from src/main/java/com/seam/api/types/UnmanagedGetResponseAccessCode.java rename to src/main/java/com/seam/api/types/UnmanagedAccessCode.java index a50f592..2ae0dc9 100644 --- a/src/main/java/com/seam/api/types/UnmanagedGetResponseAccessCode.java +++ b/src/main/java/com/seam/api/types/UnmanagedAccessCode.java @@ -19,9 +19,9 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = UnmanagedGetResponseAccessCode.Builder.class) -public final class UnmanagedGetResponseAccessCode { - private final UnmanagedGetResponseAccessCodeType type; +@JsonDeserialize(builder = UnmanagedAccessCode.Builder.class) +public final class UnmanagedAccessCode { + private final UnmanagedAccessCodeType type; private final String accessCodeId; @@ -45,8 +45,8 @@ public final class UnmanagedGetResponseAccessCode { private final Map additionalProperties; - private UnmanagedGetResponseAccessCode( - UnmanagedGetResponseAccessCodeType type, + private UnmanagedAccessCode( + UnmanagedAccessCodeType type, String accessCodeId, String deviceId, Optional name, @@ -72,31 +72,49 @@ private UnmanagedGetResponseAccessCode( this.additionalProperties = additionalProperties; } + /** + * @return Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration. + */ @JsonProperty("type") - public UnmanagedGetResponseAccessCodeType getType() { + public UnmanagedAccessCodeType getType() { return type; } + /** + * @return Unique identifier for the access code. + */ @JsonProperty("access_code_id") public String getAccessCodeId() { return accessCodeId; } + /** + * @return Unique identifier for the device associated with the access code. + */ @JsonProperty("device_id") public String getDeviceId() { return deviceId; } + /** + * @return Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + */ @JsonProperty("name") public Optional getName() { return name; } + /** + * @return Code used for access. Typically, a numeric or alphanumeric string. + */ @JsonProperty("code") public Optional getCode() { return code; } + /** + * @return Date and time at which the access code was created. + */ @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; @@ -117,11 +135,17 @@ public boolean getIsManaged() { return isManaged; } + /** + * @return Date and time at which the time-bound access code becomes active. + */ @JsonProperty("starts_at") public Optional getStartsAt() { return startsAt; } + /** + * @return Date and time after which the time-bound access code becomes inactive. + */ @JsonProperty("ends_at") public Optional getEndsAt() { return endsAt; @@ -132,10 +156,10 @@ public String getStatus() { return "set"; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof UnmanagedGetResponseAccessCode && equalTo((UnmanagedGetResponseAccessCode) other); + return other instanceof UnmanagedAccessCode && equalTo((UnmanagedAccessCode) other); } @JsonAnyGetter @@ -143,7 +167,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(UnmanagedGetResponseAccessCode other) { + private boolean equalTo(UnmanagedAccessCode other) { return type.equals(other.type) && accessCodeId.equals(other.accessCodeId) && deviceId.equals(other.deviceId) @@ -157,7 +181,7 @@ private boolean equalTo(UnmanagedGetResponseAccessCode other) { && endsAt.equals(other.endsAt); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.type, @@ -173,7 +197,7 @@ public int hashCode() { this.endsAt); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -183,9 +207,9 @@ public static TypeStage builder() { } public interface TypeStage { - AccessCodeIdStage type(UnmanagedGetResponseAccessCodeType type); + AccessCodeIdStage type(UnmanagedAccessCodeType type); - Builder from(UnmanagedGetResponseAccessCode other); + Builder from(UnmanagedAccessCode other); } public interface AccessCodeIdStage { @@ -205,7 +229,7 @@ public interface IsManagedStage { } public interface _FinalStage { - UnmanagedGetResponseAccessCode build(); + UnmanagedAccessCode build(); _FinalStage name(Optional name); @@ -235,7 +259,7 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements TypeStage, AccessCodeIdStage, DeviceIdStage, CreatedAtStage, IsManagedStage, _FinalStage { - private UnmanagedGetResponseAccessCodeType type; + private UnmanagedAccessCodeType type; private String accessCodeId; @@ -262,8 +286,8 @@ public static final class Builder private Builder() {} - @Override - public Builder from(UnmanagedGetResponseAccessCode other) { + @java.lang.Override + public Builder from(UnmanagedAccessCode other) { type(other.getType()); accessCodeId(other.getAccessCodeId()); deviceId(other.getDeviceId()); @@ -278,122 +302,154 @@ public Builder from(UnmanagedGetResponseAccessCode other) { return this; } - @Override + /** + *

Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("type") - public AccessCodeIdStage type(UnmanagedGetResponseAccessCodeType type) { + public AccessCodeIdStage type(UnmanagedAccessCodeType type) { this.type = type; return this; } - @Override + /** + *

Unique identifier for the access code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("access_code_id") public DeviceIdStage accessCodeId(String accessCodeId) { this.accessCodeId = accessCodeId; return this; } - @Override + /** + *

Unique identifier for the device associated with the access code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("device_id") public CreatedAtStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + /** + *

Date and time at which the access code was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("created_at") public IsManagedStage createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override @JsonSetter("is_managed") public _FinalStage isManaged(boolean isManaged) { this.isManaged = isManaged; return this; } - @Override + /** + *

Date and time after which the time-bound access code becomes inactive.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage endsAt(OffsetDateTime endsAt) { this.endsAt = Optional.of(endsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) public _FinalStage endsAt(Optional endsAt) { this.endsAt = endsAt; return this; } - @Override + /** + *

Date and time at which the time-bound access code becomes active.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage startsAt(OffsetDateTime startsAt) { this.startsAt = Optional.of(startsAt); return this; } - @Override + @java.lang.Override @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) public _FinalStage startsAt(Optional startsAt) { this.startsAt = startsAt; return this; } - @Override + @java.lang.Override public _FinalStage warnings(Object warnings) { this.warnings = Optional.of(warnings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "warnings", nulls = Nulls.SKIP) public _FinalStage warnings(Optional warnings) { this.warnings = warnings; return this; } - @Override + @java.lang.Override public _FinalStage errors(Object errors) { this.errors = Optional.of(errors); return this; } - @Override + @java.lang.Override @JsonSetter(value = "errors", nulls = Nulls.SKIP) public _FinalStage errors(Optional errors) { this.errors = errors; return this; } - @Override + /** + *

Code used for access. Typically, a numeric or alphanumeric string.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage code(String code) { this.code = Optional.of(code); return this; } - @Override + @java.lang.Override @JsonSetter(value = "code", nulls = Nulls.SKIP) public _FinalStage code(Optional code) { this.code = code; return this; } - @Override + /** + *

Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage name(String name) { this.name = Optional.of(name); return this; } - @Override + @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional name) { this.name = name; return this; } - @Override - public UnmanagedGetResponseAccessCode build() { - return new UnmanagedGetResponseAccessCode( + @java.lang.Override + public UnmanagedAccessCode build() { + return new UnmanagedAccessCode( type, accessCodeId, deviceId, diff --git a/src/main/java/com/seam/api/types/UnmanagedGetResponseAccessCodeType.java b/src/main/java/com/seam/api/types/UnmanagedAccessCodeType.java similarity index 75% rename from src/main/java/com/seam/api/types/UnmanagedGetResponseAccessCodeType.java rename to src/main/java/com/seam/api/types/UnmanagedAccessCodeType.java index abb4310..b1fe94f 100644 --- a/src/main/java/com/seam/api/types/UnmanagedGetResponseAccessCodeType.java +++ b/src/main/java/com/seam/api/types/UnmanagedAccessCodeType.java @@ -5,19 +5,19 @@ import com.fasterxml.jackson.annotation.JsonValue; -public enum UnmanagedGetResponseAccessCodeType { +public enum UnmanagedAccessCodeType { TIME_BOUND("time_bound"), ONGOING("ongoing"); private final String value; - UnmanagedGetResponseAccessCodeType(String value) { + UnmanagedAccessCodeType(String value) { this.value = value; } @JsonValue - @Override + @java.lang.Override public String toString() { return this.value; } diff --git a/src/main/java/com/seam/api/types/UnmanagedDevice.java b/src/main/java/com/seam/api/types/UnmanagedDevice.java index 8641f0e..ec89f2c 100644 --- a/src/main/java/com/seam/api/types/UnmanagedDevice.java +++ b/src/main/java/com/seam/api/types/UnmanagedDevice.java @@ -18,6 +18,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = UnmanagedDevice.Builder.class) @@ -28,7 +29,7 @@ public final class UnmanagedDevice { private final String connectedAccountId; - private final List capabilitiesSupported; + private final List capabilitiesSupported; private final String workspaceId; @@ -42,19 +43,43 @@ public final class UnmanagedDevice { private final UnmanagedDeviceProperties properties; + private final Optional canRemotelyUnlock; + + private final Optional canRemotelyLock; + + private final Optional canProgramOfflineAccessCodes; + + private final Optional canProgramOnlineAccessCodes; + + private final Optional canSimulateRemoval; + + private final Optional canSimulateConnection; + + private final Optional canSimulateDisconnection; + + private final Optional deviceProvider; + private final Map additionalProperties; private UnmanagedDevice( String deviceId, DeviceType deviceType, String connectedAccountId, - List capabilitiesSupported, + List capabilitiesSupported, String workspaceId, List errors, List warnings, OffsetDateTime createdAt, boolean isManaged, UnmanagedDeviceProperties properties, + Optional canRemotelyUnlock, + Optional canRemotelyLock, + Optional canProgramOfflineAccessCodes, + Optional canProgramOnlineAccessCodes, + Optional canSimulateRemoval, + Optional canSimulateConnection, + Optional canSimulateDisconnection, + Optional deviceProvider, Map additionalProperties) { this.deviceId = deviceId; this.deviceType = deviceType; @@ -66,44 +91,76 @@ private UnmanagedDevice( this.createdAt = createdAt; this.isManaged = isManaged; this.properties = properties; + this.canRemotelyUnlock = canRemotelyUnlock; + this.canRemotelyLock = canRemotelyLock; + this.canProgramOfflineAccessCodes = canProgramOfflineAccessCodes; + this.canProgramOnlineAccessCodes = canProgramOnlineAccessCodes; + this.canSimulateRemoval = canSimulateRemoval; + this.canSimulateConnection = canSimulateConnection; + this.canSimulateDisconnection = canSimulateDisconnection; + this.deviceProvider = deviceProvider; this.additionalProperties = additionalProperties; } + /** + * @return Unique identifier for the device. + */ @JsonProperty("device_id") public String getDeviceId() { return deviceId; } + /** + * @return Type of the device. + */ @JsonProperty("device_type") public DeviceType getDeviceType() { return deviceType; } + /** + * @return Unique identifier for the account associated with the device. + */ @JsonProperty("connected_account_id") public String getConnectedAccountId() { return connectedAccountId; } + /** + * @return Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health. + */ @JsonProperty("capabilities_supported") - public List getCapabilitiesSupported() { + public List getCapabilitiesSupported() { return capabilitiesSupported; } + /** + * @return Unique identifier for the Seam workspace associated with the device. + */ @JsonProperty("workspace_id") public String getWorkspaceId() { return workspaceId; } + /** + * @return Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + */ @JsonProperty("errors") public List getErrors() { return errors; } + /** + * @return Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + */ @JsonProperty("warnings") public List getWarnings() { return warnings; } + /** + * @return Date and time at which the device object was created. + */ @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; @@ -119,7 +176,47 @@ public UnmanagedDeviceProperties getProperties() { return properties; } - @Override + @JsonProperty("can_remotely_unlock") + public Optional getCanRemotelyUnlock() { + return canRemotelyUnlock; + } + + @JsonProperty("can_remotely_lock") + public Optional getCanRemotelyLock() { + return canRemotelyLock; + } + + @JsonProperty("can_program_offline_access_codes") + public Optional getCanProgramOfflineAccessCodes() { + return canProgramOfflineAccessCodes; + } + + @JsonProperty("can_program_online_access_codes") + public Optional getCanProgramOnlineAccessCodes() { + return canProgramOnlineAccessCodes; + } + + @JsonProperty("can_simulate_removal") + public Optional getCanSimulateRemoval() { + return canSimulateRemoval; + } + + @JsonProperty("can_simulate_connection") + public Optional getCanSimulateConnection() { + return canSimulateConnection; + } + + @JsonProperty("can_simulate_disconnection") + public Optional getCanSimulateDisconnection() { + return canSimulateDisconnection; + } + + @JsonProperty("device_provider") + public Optional getDeviceProvider() { + return deviceProvider; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedDevice && equalTo((UnmanagedDevice) other); @@ -140,10 +237,18 @@ private boolean equalTo(UnmanagedDevice other) { && warnings.equals(other.warnings) && createdAt.equals(other.createdAt) && isManaged == other.isManaged - && properties.equals(other.properties); + && properties.equals(other.properties) + && canRemotelyUnlock.equals(other.canRemotelyUnlock) + && canRemotelyLock.equals(other.canRemotelyLock) + && canProgramOfflineAccessCodes.equals(other.canProgramOfflineAccessCodes) + && canProgramOnlineAccessCodes.equals(other.canProgramOnlineAccessCodes) + && canSimulateRemoval.equals(other.canSimulateRemoval) + && canSimulateConnection.equals(other.canSimulateConnection) + && canSimulateDisconnection.equals(other.canSimulateDisconnection) + && deviceProvider.equals(other.deviceProvider); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash( this.deviceId, @@ -155,10 +260,18 @@ public int hashCode() { this.warnings, this.createdAt, this.isManaged, - this.properties); + this.properties, + this.canRemotelyUnlock, + this.canRemotelyLock, + this.canProgramOfflineAccessCodes, + this.canProgramOnlineAccessCodes, + this.canSimulateRemoval, + this.canSimulateConnection, + this.canSimulateDisconnection, + this.deviceProvider); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -200,11 +313,11 @@ public interface PropertiesStage { public interface _FinalStage { UnmanagedDevice build(); - _FinalStage capabilitiesSupported(List capabilitiesSupported); + _FinalStage capabilitiesSupported(List capabilitiesSupported); - _FinalStage addCapabilitiesSupported(SupportedCapabililty capabilitiesSupported); + _FinalStage addCapabilitiesSupported(UnmanagedDeviceCapabilitiesSupportedItem capabilitiesSupported); - _FinalStage addAllCapabilitiesSupported(List capabilitiesSupported); + _FinalStage addAllCapabilitiesSupported(List capabilitiesSupported); _FinalStage errors(List errors); @@ -217,6 +330,38 @@ public interface _FinalStage { _FinalStage addWarnings(UnmanagedDeviceWarningsItem warnings); _FinalStage addAllWarnings(List warnings); + + _FinalStage canRemotelyUnlock(Optional canRemotelyUnlock); + + _FinalStage canRemotelyUnlock(Boolean canRemotelyUnlock); + + _FinalStage canRemotelyLock(Optional canRemotelyLock); + + _FinalStage canRemotelyLock(Boolean canRemotelyLock); + + _FinalStage canProgramOfflineAccessCodes(Optional canProgramOfflineAccessCodes); + + _FinalStage canProgramOfflineAccessCodes(Boolean canProgramOfflineAccessCodes); + + _FinalStage canProgramOnlineAccessCodes(Optional canProgramOnlineAccessCodes); + + _FinalStage canProgramOnlineAccessCodes(Boolean canProgramOnlineAccessCodes); + + _FinalStage canSimulateRemoval(Optional canSimulateRemoval); + + _FinalStage canSimulateRemoval(Boolean canSimulateRemoval); + + _FinalStage canSimulateConnection(Optional canSimulateConnection); + + _FinalStage canSimulateConnection(Boolean canSimulateConnection); + + _FinalStage canSimulateDisconnection(Optional canSimulateDisconnection); + + _FinalStage canSimulateDisconnection(Boolean canSimulateDisconnection); + + _FinalStage deviceProvider(Optional deviceProvider); + + _FinalStage deviceProvider(UnmanagedDeviceDeviceProvider deviceProvider); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -243,18 +388,34 @@ public static final class Builder private UnmanagedDeviceProperties properties; + private Optional deviceProvider = Optional.empty(); + + private Optional canSimulateDisconnection = Optional.empty(); + + private Optional canSimulateConnection = Optional.empty(); + + private Optional canSimulateRemoval = Optional.empty(); + + private Optional canProgramOnlineAccessCodes = Optional.empty(); + + private Optional canProgramOfflineAccessCodes = Optional.empty(); + + private Optional canRemotelyLock = Optional.empty(); + + private Optional canRemotelyUnlock = Optional.empty(); + private List warnings = new ArrayList<>(); private List errors = new ArrayList<>(); - private List capabilitiesSupported = new ArrayList<>(); + private List capabilitiesSupported = new ArrayList<>(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedDevice other) { deviceId(other.getDeviceId()); deviceType(other.getDeviceType()); @@ -266,71 +427,211 @@ public Builder from(UnmanagedDevice other) { createdAt(other.getCreatedAt()); isManaged(other.getIsManaged()); properties(other.getProperties()); + canRemotelyUnlock(other.getCanRemotelyUnlock()); + canRemotelyLock(other.getCanRemotelyLock()); + canProgramOfflineAccessCodes(other.getCanProgramOfflineAccessCodes()); + canProgramOnlineAccessCodes(other.getCanProgramOnlineAccessCodes()); + canSimulateRemoval(other.getCanSimulateRemoval()); + canSimulateConnection(other.getCanSimulateConnection()); + canSimulateDisconnection(other.getCanSimulateDisconnection()); + deviceProvider(other.getDeviceProvider()); return this; } - @Override + /** + *

Unique identifier for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("device_id") public DeviceTypeStage deviceId(String deviceId) { this.deviceId = deviceId; return this; } - @Override + /** + *

Type of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("device_type") public ConnectedAccountIdStage deviceType(DeviceType deviceType) { this.deviceType = deviceType; return this; } - @Override + /** + *

Unique identifier for the account associated with the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("connected_account_id") public WorkspaceIdStage connectedAccountId(String connectedAccountId) { this.connectedAccountId = connectedAccountId; return this; } - @Override + /** + *

Unique identifier for the Seam workspace associated with the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("workspace_id") public CreatedAtStage workspaceId(String workspaceId) { this.workspaceId = workspaceId; return this; } - @Override + /** + *

Date and time at which the device object was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("created_at") public IsManagedStage createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Override + @java.lang.Override @JsonSetter("is_managed") public PropertiesStage isManaged(boolean isManaged) { this.isManaged = isManaged; return this; } - @Override + @java.lang.Override @JsonSetter("properties") public _FinalStage properties(UnmanagedDeviceProperties properties) { this.properties = properties; return this; } - @Override + @java.lang.Override + public _FinalStage deviceProvider(UnmanagedDeviceDeviceProvider deviceProvider) { + this.deviceProvider = Optional.of(deviceProvider); + return this; + } + + @java.lang.Override + @JsonSetter(value = "device_provider", nulls = Nulls.SKIP) + public _FinalStage deviceProvider(Optional deviceProvider) { + this.deviceProvider = deviceProvider; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateDisconnection(Boolean canSimulateDisconnection) { + this.canSimulateDisconnection = Optional.of(canSimulateDisconnection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_disconnection", nulls = Nulls.SKIP) + public _FinalStage canSimulateDisconnection(Optional canSimulateDisconnection) { + this.canSimulateDisconnection = canSimulateDisconnection; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateConnection(Boolean canSimulateConnection) { + this.canSimulateConnection = Optional.of(canSimulateConnection); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_connection", nulls = Nulls.SKIP) + public _FinalStage canSimulateConnection(Optional canSimulateConnection) { + this.canSimulateConnection = canSimulateConnection; + return this; + } + + @java.lang.Override + public _FinalStage canSimulateRemoval(Boolean canSimulateRemoval) { + this.canSimulateRemoval = Optional.of(canSimulateRemoval); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_simulate_removal", nulls = Nulls.SKIP) + public _FinalStage canSimulateRemoval(Optional canSimulateRemoval) { + this.canSimulateRemoval = canSimulateRemoval; + return this; + } + + @java.lang.Override + public _FinalStage canProgramOnlineAccessCodes(Boolean canProgramOnlineAccessCodes) { + this.canProgramOnlineAccessCodes = Optional.of(canProgramOnlineAccessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_program_online_access_codes", nulls = Nulls.SKIP) + public _FinalStage canProgramOnlineAccessCodes(Optional canProgramOnlineAccessCodes) { + this.canProgramOnlineAccessCodes = canProgramOnlineAccessCodes; + return this; + } + + @java.lang.Override + public _FinalStage canProgramOfflineAccessCodes(Boolean canProgramOfflineAccessCodes) { + this.canProgramOfflineAccessCodes = Optional.of(canProgramOfflineAccessCodes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_program_offline_access_codes", nulls = Nulls.SKIP) + public _FinalStage canProgramOfflineAccessCodes(Optional canProgramOfflineAccessCodes) { + this.canProgramOfflineAccessCodes = canProgramOfflineAccessCodes; + return this; + } + + @java.lang.Override + public _FinalStage canRemotelyLock(Boolean canRemotelyLock) { + this.canRemotelyLock = Optional.of(canRemotelyLock); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_remotely_lock", nulls = Nulls.SKIP) + public _FinalStage canRemotelyLock(Optional canRemotelyLock) { + this.canRemotelyLock = canRemotelyLock; + return this; + } + + @java.lang.Override + public _FinalStage canRemotelyUnlock(Boolean canRemotelyUnlock) { + this.canRemotelyUnlock = Optional.of(canRemotelyUnlock); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_remotely_unlock", nulls = Nulls.SKIP) + public _FinalStage canRemotelyUnlock(Optional canRemotelyUnlock) { + this.canRemotelyUnlock = canRemotelyUnlock; + return this; + } + + /** + *

Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addAllWarnings(List warnings) { this.warnings.addAll(warnings); return this; } - @Override + /** + *

Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addWarnings(UnmanagedDeviceWarningsItem warnings) { this.warnings.add(warnings); return this; } - @Override + @java.lang.Override @JsonSetter(value = "warnings", nulls = Nulls.SKIP) public _FinalStage warnings(List warnings) { this.warnings.clear(); @@ -338,19 +639,27 @@ public _FinalStage warnings(List warnings) { return this; } - @Override + /** + *

Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addAllErrors(List errors) { this.errors.addAll(errors); return this; } - @Override + /** + *

Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage addErrors(UnmanagedDeviceErrorsItem errors) { this.errors.add(errors); return this; } - @Override + @java.lang.Override @JsonSetter(value = "errors", nulls = Nulls.SKIP) public _FinalStage errors(List errors) { this.errors.clear(); @@ -358,27 +667,36 @@ public _FinalStage errors(List errors) { return this; } - @Override - public _FinalStage addAllCapabilitiesSupported(List capabilitiesSupported) { + /** + *

Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCapabilitiesSupported( + List capabilitiesSupported) { this.capabilitiesSupported.addAll(capabilitiesSupported); return this; } - @Override - public _FinalStage addCapabilitiesSupported(SupportedCapabililty capabilitiesSupported) { + /** + *

Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCapabilitiesSupported(UnmanagedDeviceCapabilitiesSupportedItem capabilitiesSupported) { this.capabilitiesSupported.add(capabilitiesSupported); return this; } - @Override + @java.lang.Override @JsonSetter(value = "capabilities_supported", nulls = Nulls.SKIP) - public _FinalStage capabilitiesSupported(List capabilitiesSupported) { + public _FinalStage capabilitiesSupported(List capabilitiesSupported) { this.capabilitiesSupported.clear(); this.capabilitiesSupported.addAll(capabilitiesSupported); return this; } - @Override + @java.lang.Override public UnmanagedDevice build() { return new UnmanagedDevice( deviceId, @@ -391,6 +709,14 @@ public UnmanagedDevice build() { createdAt, isManaged, properties, + canRemotelyUnlock, + canRemotelyLock, + canProgramOfflineAccessCodes, + canProgramOnlineAccessCodes, + canSimulateRemoval, + canSimulateConnection, + canSimulateDisconnection, + deviceProvider, additionalProperties); } } diff --git a/src/main/java/com/seam/api/types/UnmanagedDeviceCapabilitiesSupportedItem.java b/src/main/java/com/seam/api/types/UnmanagedDeviceCapabilitiesSupportedItem.java new file mode 100644 index 0000000..ef8dc06 --- /dev/null +++ b/src/main/java/com/seam/api/types/UnmanagedDeviceCapabilitiesSupportedItem.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UnmanagedDeviceCapabilitiesSupportedItem { + ACCESS_CODE("access_code"), + + LOCK("lock"), + + NOISE_DETECTION("noise_detection"), + + THERMOSTAT("thermostat"), + + BATTERY("battery"), + + PHONE("phone"); + + private final String value; + + UnmanagedDeviceCapabilitiesSupportedItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedDeviceDeviceProvider.java b/src/main/java/com/seam/api/types/UnmanagedDeviceDeviceProvider.java new file mode 100644 index 0000000..a2ab459 --- /dev/null +++ b/src/main/java/com/seam/api/types/UnmanagedDeviceDeviceProvider.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedDeviceDeviceProvider.Builder.class) +public final class UnmanagedDeviceDeviceProvider { + private final Optional providerCategories; + + private final Map additionalProperties; + + private UnmanagedDeviceDeviceProvider( + Optional providerCategories, Map additionalProperties) { + this.providerCategories = providerCategories; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider_categories") + public Optional getProviderCategories() { + return providerCategories; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedDeviceDeviceProvider && equalTo((UnmanagedDeviceDeviceProvider) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedDeviceDeviceProvider other) { + return providerCategories.equals(other.providerCategories); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.providerCategories); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional providerCategories = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UnmanagedDeviceDeviceProvider other) { + providerCategories(other.getProviderCategories()); + return this; + } + + @JsonSetter(value = "provider_categories", nulls = Nulls.SKIP) + public Builder providerCategories(Optional providerCategories) { + this.providerCategories = providerCategories; + return this; + } + + public Builder providerCategories(Object providerCategories) { + this.providerCategories = Optional.of(providerCategories); + return this; + } + + public UnmanagedDeviceDeviceProvider build() { + return new UnmanagedDeviceDeviceProvider(providerCategories, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedDeviceErrorsItem.java b/src/main/java/com/seam/api/types/UnmanagedDeviceErrorsItem.java index bfea6f6..cfb9a67 100644 --- a/src/main/java/com/seam/api/types/UnmanagedDeviceErrorsItem.java +++ b/src/main/java/com/seam/api/types/UnmanagedDeviceErrorsItem.java @@ -40,7 +40,7 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedDeviceErrorsItem && equalTo((UnmanagedDeviceErrorsItem) other); @@ -55,12 +55,12 @@ private boolean equalTo(UnmanagedDeviceErrorsItem other) { return errorCode.equals(other.errorCode) && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.errorCode, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +94,28 @@ public static final class Builder implements ErrorCodeStage, MessageStage, _Fina private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedDeviceErrorsItem other) { errorCode(other.getErrorCode()); message(other.getMessage()); return this; } - @Override + @java.lang.Override @JsonSetter("error_code") public MessageStage errorCode(String errorCode) { this.errorCode = errorCode; return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(String message) { this.message = message; return this; } - @Override + @java.lang.Override public UnmanagedDeviceErrorsItem build() { return new UnmanagedDeviceErrorsItem(errorCode, message, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/UnmanagedDeviceProperties.java b/src/main/java/com/seam/api/types/UnmanagedDeviceProperties.java index abff0c9..94bb19e 100644 --- a/src/main/java/com/seam/api/types/UnmanagedDeviceProperties.java +++ b/src/main/java/com/seam/api/types/UnmanagedDeviceProperties.java @@ -20,6 +20,8 @@ @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = UnmanagedDeviceProperties.Builder.class) public final class UnmanagedDeviceProperties { + private final Optional accessoryKeypad; + private final String name; private final boolean online; @@ -30,58 +32,131 @@ public final class UnmanagedDeviceProperties { private final Optional imageAltText; + private final Optional batteryLevel; + + private final Optional battery; + + private final Optional onlineAccessCodesEnabled; + + private final Optional offlineAccessCodesEnabled; + private final UnmanagedDevicePropertiesModel model; private final Map additionalProperties; private UnmanagedDeviceProperties( + Optional accessoryKeypad, String name, boolean online, Optional manufacturer, Optional imageUrl, Optional imageAltText, + Optional batteryLevel, + Optional battery, + Optional onlineAccessCodesEnabled, + Optional offlineAccessCodesEnabled, UnmanagedDevicePropertiesModel model, Map additionalProperties) { + this.accessoryKeypad = accessoryKeypad; this.name = name; this.online = online; this.manufacturer = manufacturer; this.imageUrl = imageUrl; this.imageAltText = imageAltText; + this.batteryLevel = batteryLevel; + this.battery = battery; + this.onlineAccessCodesEnabled = onlineAccessCodesEnabled; + this.offlineAccessCodesEnabled = offlineAccessCodesEnabled; this.model = model; this.additionalProperties = additionalProperties; } + /** + * @return Represents the accessory keypad state. + */ + @JsonProperty("accessory_keypad") + public Optional getAccessoryKeypad() { + return accessoryKeypad; + } + + /** + * @return Name of the device. + */ @JsonProperty("name") public String getName() { return name; } + /** + * @return Indicates whether the device is online. + */ @JsonProperty("online") public boolean getOnline() { return online; } + /** + * @return Manufacturer of the device. + */ @JsonProperty("manufacturer") public Optional getManufacturer() { return manufacturer; } + /** + * @return Image URL for the device. + */ @JsonProperty("image_url") public Optional getImageUrl() { return imageUrl; } + /** + * @return Alt text for the device image. + */ @JsonProperty("image_alt_text") public Optional getImageAltText() { return imageAltText; } + /** + * @return Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. + */ + @JsonProperty("battery_level") + public Optional getBatteryLevel() { + return batteryLevel; + } + + /** + * @return Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage. + */ + @JsonProperty("battery") + public Optional getBattery() { + return battery; + } + + /** + * @return Indicates whether it is currently possible to use online access codes for the device. + */ + @JsonProperty("online_access_codes_enabled") + public Optional getOnlineAccessCodesEnabled() { + return onlineAccessCodesEnabled; + } + + /** + * @return Indicates whether it is currently possible to use offline access codes for the device. + */ + @JsonProperty("offline_access_codes_enabled") + public Optional getOfflineAccessCodesEnabled() { + return offlineAccessCodesEnabled; + } + @JsonProperty("model") public UnmanagedDevicePropertiesModel getModel() { return model; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedDeviceProperties && equalTo((UnmanagedDeviceProperties) other); @@ -93,20 +168,36 @@ public Map getAdditionalProperties() { } private boolean equalTo(UnmanagedDeviceProperties other) { - return name.equals(other.name) + return accessoryKeypad.equals(other.accessoryKeypad) + && name.equals(other.name) && online == other.online && manufacturer.equals(other.manufacturer) && imageUrl.equals(other.imageUrl) && imageAltText.equals(other.imageAltText) + && batteryLevel.equals(other.batteryLevel) + && battery.equals(other.battery) + && onlineAccessCodesEnabled.equals(other.onlineAccessCodesEnabled) + && offlineAccessCodesEnabled.equals(other.offlineAccessCodesEnabled) && model.equals(other.model); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.name, this.online, this.manufacturer, this.imageUrl, this.imageAltText, this.model); + return Objects.hash( + this.accessoryKeypad, + this.name, + this.online, + this.manufacturer, + this.imageUrl, + this.imageAltText, + this.batteryLevel, + this.battery, + this.onlineAccessCodesEnabled, + this.offlineAccessCodesEnabled, + this.model); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -132,6 +223,10 @@ public interface ModelStage { public interface _FinalStage { UnmanagedDeviceProperties build(); + _FinalStage accessoryKeypad(Optional accessoryKeypad); + + _FinalStage accessoryKeypad(UnmanagedDevicePropertiesAccessoryKeypad accessoryKeypad); + _FinalStage manufacturer(Optional manufacturer); _FinalStage manufacturer(String manufacturer); @@ -143,6 +238,22 @@ public interface _FinalStage { _FinalStage imageAltText(Optional imageAltText); _FinalStage imageAltText(String imageAltText); + + _FinalStage batteryLevel(Optional batteryLevel); + + _FinalStage batteryLevel(Double batteryLevel); + + _FinalStage battery(Optional battery); + + _FinalStage battery(UnmanagedDevicePropertiesBattery battery); + + _FinalStage onlineAccessCodesEnabled(Optional onlineAccessCodesEnabled); + + _FinalStage onlineAccessCodesEnabled(Boolean onlineAccessCodesEnabled); + + _FinalStage offlineAccessCodesEnabled(Optional offlineAccessCodesEnabled); + + _FinalStage offlineAccessCodesEnabled(Boolean offlineAccessCodesEnabled); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -153,92 +264,223 @@ public static final class Builder implements NameStage, OnlineStage, ModelStage, private UnmanagedDevicePropertiesModel model; + private Optional offlineAccessCodesEnabled = Optional.empty(); + + private Optional onlineAccessCodesEnabled = Optional.empty(); + + private Optional battery = Optional.empty(); + + private Optional batteryLevel = Optional.empty(); + private Optional imageAltText = Optional.empty(); private Optional imageUrl = Optional.empty(); private Optional manufacturer = Optional.empty(); + private Optional accessoryKeypad = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedDeviceProperties other) { + accessoryKeypad(other.getAccessoryKeypad()); name(other.getName()); online(other.getOnline()); manufacturer(other.getManufacturer()); imageUrl(other.getImageUrl()); imageAltText(other.getImageAltText()); + batteryLevel(other.getBatteryLevel()); + battery(other.getBattery()); + onlineAccessCodesEnabled(other.getOnlineAccessCodesEnabled()); + offlineAccessCodesEnabled(other.getOfflineAccessCodesEnabled()); model(other.getModel()); return this; } - @Override + /** + *

Name of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("name") public OnlineStage name(String name) { this.name = name; return this; } - @Override + /** + *

Indicates whether the device is online.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("online") public ModelStage online(boolean online) { this.online = online; return this; } - @Override + @java.lang.Override @JsonSetter("model") public _FinalStage model(UnmanagedDevicePropertiesModel model) { this.model = model; return this; } - @Override + /** + *

Indicates whether it is currently possible to use offline access codes for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage offlineAccessCodesEnabled(Boolean offlineAccessCodesEnabled) { + this.offlineAccessCodesEnabled = Optional.of(offlineAccessCodesEnabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "offline_access_codes_enabled", nulls = Nulls.SKIP) + public _FinalStage offlineAccessCodesEnabled(Optional offlineAccessCodesEnabled) { + this.offlineAccessCodesEnabled = offlineAccessCodesEnabled; + return this; + } + + /** + *

Indicates whether it is currently possible to use online access codes for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage onlineAccessCodesEnabled(Boolean onlineAccessCodesEnabled) { + this.onlineAccessCodesEnabled = Optional.of(onlineAccessCodesEnabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "online_access_codes_enabled", nulls = Nulls.SKIP) + public _FinalStage onlineAccessCodesEnabled(Optional onlineAccessCodesEnabled) { + this.onlineAccessCodesEnabled = onlineAccessCodesEnabled; + return this; + } + + /** + *

Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage battery(UnmanagedDevicePropertiesBattery battery) { + this.battery = Optional.of(battery); + return this; + } + + @java.lang.Override + @JsonSetter(value = "battery", nulls = Nulls.SKIP) + public _FinalStage battery(Optional battery) { + this.battery = battery; + return this; + } + + /** + *

Indicates the battery level of the device as a decimal value between 0 and 1, inclusive.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage batteryLevel(Double batteryLevel) { + this.batteryLevel = Optional.of(batteryLevel); + return this; + } + + @java.lang.Override + @JsonSetter(value = "battery_level", nulls = Nulls.SKIP) + public _FinalStage batteryLevel(Optional batteryLevel) { + this.batteryLevel = batteryLevel; + return this; + } + + /** + *

Alt text for the device image.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage imageAltText(String imageAltText) { this.imageAltText = Optional.of(imageAltText); return this; } - @Override + @java.lang.Override @JsonSetter(value = "image_alt_text", nulls = Nulls.SKIP) public _FinalStage imageAltText(Optional imageAltText) { this.imageAltText = imageAltText; return this; } - @Override + /** + *

Image URL for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage imageUrl(String imageUrl) { this.imageUrl = Optional.of(imageUrl); return this; } - @Override + @java.lang.Override @JsonSetter(value = "image_url", nulls = Nulls.SKIP) public _FinalStage imageUrl(Optional imageUrl) { this.imageUrl = imageUrl; return this; } - @Override + /** + *

Manufacturer of the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override public _FinalStage manufacturer(String manufacturer) { this.manufacturer = Optional.of(manufacturer); return this; } - @Override + @java.lang.Override @JsonSetter(value = "manufacturer", nulls = Nulls.SKIP) public _FinalStage manufacturer(Optional manufacturer) { this.manufacturer = manufacturer; return this; } - @Override + /** + *

Represents the accessory keypad state.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage accessoryKeypad(UnmanagedDevicePropertiesAccessoryKeypad accessoryKeypad) { + this.accessoryKeypad = Optional.of(accessoryKeypad); + return this; + } + + @java.lang.Override + @JsonSetter(value = "accessory_keypad", nulls = Nulls.SKIP) + public _FinalStage accessoryKeypad(Optional accessoryKeypad) { + this.accessoryKeypad = accessoryKeypad; + return this; + } + + @java.lang.Override public UnmanagedDeviceProperties build() { return new UnmanagedDeviceProperties( - name, online, manufacturer, imageUrl, imageAltText, model, additionalProperties); + accessoryKeypad, + name, + online, + manufacturer, + imageUrl, + imageAltText, + batteryLevel, + battery, + onlineAccessCodesEnabled, + offlineAccessCodesEnabled, + model, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypad.java b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypad.java new file mode 100644 index 0000000..339cdc3 --- /dev/null +++ b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypad.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedDevicePropertiesAccessoryKeypad.Builder.class) +public final class UnmanagedDevicePropertiesAccessoryKeypad { + private final boolean isConnected; + + private final Optional battery; + + private final Map additionalProperties; + + private UnmanagedDevicePropertiesAccessoryKeypad( + boolean isConnected, + Optional battery, + Map additionalProperties) { + this.isConnected = isConnected; + this.battery = battery; + this.additionalProperties = additionalProperties; + } + + /** + * @return Indicates if the accessory_keypad is connected to the device. + */ + @JsonProperty("is_connected") + public boolean getIsConnected() { + return isConnected; + } + + /** + * @return Indicates if the keypad battery properties. + */ + @JsonProperty("battery") + public Optional getBattery() { + return battery; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedDevicePropertiesAccessoryKeypad + && equalTo((UnmanagedDevicePropertiesAccessoryKeypad) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedDevicePropertiesAccessoryKeypad other) { + return isConnected == other.isConnected && battery.equals(other.battery); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isConnected, this.battery); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IsConnectedStage builder() { + return new Builder(); + } + + public interface IsConnectedStage { + _FinalStage isConnected(boolean isConnected); + + Builder from(UnmanagedDevicePropertiesAccessoryKeypad other); + } + + public interface _FinalStage { + UnmanagedDevicePropertiesAccessoryKeypad build(); + + _FinalStage battery(Optional battery); + + _FinalStage battery(UnmanagedDevicePropertiesAccessoryKeypadBattery battery); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IsConnectedStage, _FinalStage { + private boolean isConnected; + + private Optional battery = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UnmanagedDevicePropertiesAccessoryKeypad other) { + isConnected(other.getIsConnected()); + battery(other.getBattery()); + return this; + } + + /** + *

Indicates if the accessory_keypad is connected to the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_connected") + public _FinalStage isConnected(boolean isConnected) { + this.isConnected = isConnected; + return this; + } + + /** + *

Indicates if the keypad battery properties.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage battery(UnmanagedDevicePropertiesAccessoryKeypadBattery battery) { + this.battery = Optional.of(battery); + return this; + } + + @java.lang.Override + @JsonSetter(value = "battery", nulls = Nulls.SKIP) + public _FinalStage battery(Optional battery) { + this.battery = battery; + return this; + } + + @java.lang.Override + public UnmanagedDevicePropertiesAccessoryKeypad build() { + return new UnmanagedDevicePropertiesAccessoryKeypad(isConnected, battery, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypadBattery.java b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypadBattery.java new file mode 100644 index 0000000..5fbaab6 --- /dev/null +++ b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesAccessoryKeypadBattery.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedDevicePropertiesAccessoryKeypadBattery.Builder.class) +public final class UnmanagedDevicePropertiesAccessoryKeypadBattery { + private final double level; + + private final Map additionalProperties; + + private UnmanagedDevicePropertiesAccessoryKeypadBattery(double level, Map additionalProperties) { + this.level = level; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("level") + public double getLevel() { + return level; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedDevicePropertiesAccessoryKeypadBattery + && equalTo((UnmanagedDevicePropertiesAccessoryKeypadBattery) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedDevicePropertiesAccessoryKeypadBattery other) { + return level == other.level; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.level); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LevelStage builder() { + return new Builder(); + } + + public interface LevelStage { + _FinalStage level(double level); + + Builder from(UnmanagedDevicePropertiesAccessoryKeypadBattery other); + } + + public interface _FinalStage { + UnmanagedDevicePropertiesAccessoryKeypadBattery build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LevelStage, _FinalStage { + private double level; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UnmanagedDevicePropertiesAccessoryKeypadBattery other) { + level(other.getLevel()); + return this; + } + + @java.lang.Override + @JsonSetter("level") + public _FinalStage level(double level) { + this.level = level; + return this; + } + + @java.lang.Override + public UnmanagedDevicePropertiesAccessoryKeypadBattery build() { + return new UnmanagedDevicePropertiesAccessoryKeypadBattery(level, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBattery.java b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBattery.java new file mode 100644 index 0000000..fd7c86f --- /dev/null +++ b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBattery.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UnmanagedDevicePropertiesBattery.Builder.class) +public final class UnmanagedDevicePropertiesBattery { + private final double level; + + private final UnmanagedDevicePropertiesBatteryStatus status; + + private final Map additionalProperties; + + private UnmanagedDevicePropertiesBattery( + double level, UnmanagedDevicePropertiesBatteryStatus status, Map additionalProperties) { + this.level = level; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("level") + public double getLevel() { + return level; + } + + @JsonProperty("status") + public UnmanagedDevicePropertiesBatteryStatus getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UnmanagedDevicePropertiesBattery && equalTo((UnmanagedDevicePropertiesBattery) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UnmanagedDevicePropertiesBattery other) { + return level == other.level && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.level, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LevelStage builder() { + return new Builder(); + } + + public interface LevelStage { + StatusStage level(double level); + + Builder from(UnmanagedDevicePropertiesBattery other); + } + + public interface StatusStage { + _FinalStage status(UnmanagedDevicePropertiesBatteryStatus status); + } + + public interface _FinalStage { + UnmanagedDevicePropertiesBattery build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LevelStage, StatusStage, _FinalStage { + private double level; + + private UnmanagedDevicePropertiesBatteryStatus status; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UnmanagedDevicePropertiesBattery other) { + level(other.getLevel()); + status(other.getStatus()); + return this; + } + + @java.lang.Override + @JsonSetter("level") + public StatusStage level(double level) { + this.level = level; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(UnmanagedDevicePropertiesBatteryStatus status) { + this.status = status; + return this; + } + + @java.lang.Override + public UnmanagedDevicePropertiesBattery build() { + return new UnmanagedDevicePropertiesBattery(level, status, additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBatteryStatus.java b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBatteryStatus.java new file mode 100644 index 0000000..49e37ab --- /dev/null +++ b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesBatteryStatus.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UnmanagedDevicePropertiesBatteryStatus { + CRITICAL("critical"), + + LOW("low"), + + GOOD("good"), + + FULL("full"); + + private final String value; + + UnmanagedDevicePropertiesBatteryStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesModel.java b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesModel.java index 3afadfa..d3643b5 100644 --- a/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesModel.java +++ b/src/main/java/com/seam/api/types/UnmanagedDevicePropertiesModel.java @@ -9,30 +9,106 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.seam.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonDeserialize(builder = UnmanagedDevicePropertiesModel.Builder.class) public final class UnmanagedDevicePropertiesModel { + private final Optional canConnectAccessoryKeypad; + private final String displayName; + private final String manufacturerDisplayName; + + private final Optional hasBuiltInKeypad; + + private final Optional offlineAccessCodesSupported; + + private final Optional onlineAccessCodesSupported; + + private final Optional accessoryKeypadSupported; + private final Map additionalProperties; - private UnmanagedDevicePropertiesModel(String displayName, Map additionalProperties) { + private UnmanagedDevicePropertiesModel( + Optional canConnectAccessoryKeypad, + String displayName, + String manufacturerDisplayName, + Optional hasBuiltInKeypad, + Optional offlineAccessCodesSupported, + Optional onlineAccessCodesSupported, + Optional accessoryKeypadSupported, + Map additionalProperties) { + this.canConnectAccessoryKeypad = canConnectAccessoryKeypad; this.displayName = displayName; + this.manufacturerDisplayName = manufacturerDisplayName; + this.hasBuiltInKeypad = hasBuiltInKeypad; + this.offlineAccessCodesSupported = offlineAccessCodesSupported; + this.onlineAccessCodesSupported = onlineAccessCodesSupported; + this.accessoryKeypadSupported = accessoryKeypadSupported; this.additionalProperties = additionalProperties; } + /** + * @return Indicates whether the device can connect a accessory keypad. + */ + @JsonProperty("can_connect_accessory_keypad") + public Optional getCanConnectAccessoryKeypad() { + return canConnectAccessoryKeypad; + } + + /** + * @return Display name of the device model. + */ @JsonProperty("display_name") public String getDisplayName() { return displayName; } - @Override + /** + * @return Display name that corresponds to the manufacturer-specific terminology for the device. + */ + @JsonProperty("manufacturer_display_name") + public String getManufacturerDisplayName() { + return manufacturerDisplayName; + } + + /** + * @return Indicates whether the device has a built in accessory keypad. + */ + @JsonProperty("has_built_in_keypad") + public Optional getHasBuiltInKeypad() { + return hasBuiltInKeypad; + } + + /** + * @return Indicates whether the device supports offline access codes. + */ + @JsonProperty("offline_access_codes_supported") + public Optional getOfflineAccessCodesSupported() { + return offlineAccessCodesSupported; + } + + /** + * @return Indicates whether the device supports online access codes. + */ + @JsonProperty("online_access_codes_supported") + public Optional getOnlineAccessCodesSupported() { + return onlineAccessCodesSupported; + } + + @JsonProperty("accessory_keypad_supported") + public Optional getAccessoryKeypadSupported() { + return accessoryKeypadSupported; + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedDevicePropertiesModel && equalTo((UnmanagedDevicePropertiesModel) other); @@ -44,15 +120,28 @@ public Map getAdditionalProperties() { } private boolean equalTo(UnmanagedDevicePropertiesModel other) { - return displayName.equals(other.displayName); + return canConnectAccessoryKeypad.equals(other.canConnectAccessoryKeypad) + && displayName.equals(other.displayName) + && manufacturerDisplayName.equals(other.manufacturerDisplayName) + && hasBuiltInKeypad.equals(other.hasBuiltInKeypad) + && offlineAccessCodesSupported.equals(other.offlineAccessCodesSupported) + && onlineAccessCodesSupported.equals(other.onlineAccessCodesSupported) + && accessoryKeypadSupported.equals(other.accessoryKeypadSupported); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.displayName); + return Objects.hash( + this.canConnectAccessoryKeypad, + this.displayName, + this.manufacturerDisplayName, + this.hasBuiltInKeypad, + this.offlineAccessCodesSupported, + this.onlineAccessCodesSupported, + this.accessoryKeypadSupported); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -62,40 +151,186 @@ public static DisplayNameStage builder() { } public interface DisplayNameStage { - _FinalStage displayName(String displayName); + ManufacturerDisplayNameStage displayName(String displayName); Builder from(UnmanagedDevicePropertiesModel other); } + public interface ManufacturerDisplayNameStage { + _FinalStage manufacturerDisplayName(String manufacturerDisplayName); + } + public interface _FinalStage { UnmanagedDevicePropertiesModel build(); + + _FinalStage canConnectAccessoryKeypad(Optional canConnectAccessoryKeypad); + + _FinalStage canConnectAccessoryKeypad(Boolean canConnectAccessoryKeypad); + + _FinalStage hasBuiltInKeypad(Optional hasBuiltInKeypad); + + _FinalStage hasBuiltInKeypad(Boolean hasBuiltInKeypad); + + _FinalStage offlineAccessCodesSupported(Optional offlineAccessCodesSupported); + + _FinalStage offlineAccessCodesSupported(Boolean offlineAccessCodesSupported); + + _FinalStage onlineAccessCodesSupported(Optional onlineAccessCodesSupported); + + _FinalStage onlineAccessCodesSupported(Boolean onlineAccessCodesSupported); + + _FinalStage accessoryKeypadSupported(Optional accessoryKeypadSupported); + + _FinalStage accessoryKeypadSupported(Boolean accessoryKeypadSupported); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DisplayNameStage, _FinalStage { + public static final class Builder implements DisplayNameStage, ManufacturerDisplayNameStage, _FinalStage { private String displayName; + private String manufacturerDisplayName; + + private Optional accessoryKeypadSupported = Optional.empty(); + + private Optional onlineAccessCodesSupported = Optional.empty(); + + private Optional offlineAccessCodesSupported = Optional.empty(); + + private Optional hasBuiltInKeypad = Optional.empty(); + + private Optional canConnectAccessoryKeypad = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedDevicePropertiesModel other) { + canConnectAccessoryKeypad(other.getCanConnectAccessoryKeypad()); displayName(other.getDisplayName()); + manufacturerDisplayName(other.getManufacturerDisplayName()); + hasBuiltInKeypad(other.getHasBuiltInKeypad()); + offlineAccessCodesSupported(other.getOfflineAccessCodesSupported()); + onlineAccessCodesSupported(other.getOnlineAccessCodesSupported()); + accessoryKeypadSupported(other.getAccessoryKeypadSupported()); return this; } - @Override + /** + *

Display name of the device model.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override @JsonSetter("display_name") - public _FinalStage displayName(String displayName) { + public ManufacturerDisplayNameStage displayName(String displayName) { this.displayName = displayName; return this; } - @Override + /** + *

Display name that corresponds to the manufacturer-specific terminology for the device.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("manufacturer_display_name") + public _FinalStage manufacturerDisplayName(String manufacturerDisplayName) { + this.manufacturerDisplayName = manufacturerDisplayName; + return this; + } + + @java.lang.Override + public _FinalStage accessoryKeypadSupported(Boolean accessoryKeypadSupported) { + this.accessoryKeypadSupported = Optional.of(accessoryKeypadSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "accessory_keypad_supported", nulls = Nulls.SKIP) + public _FinalStage accessoryKeypadSupported(Optional accessoryKeypadSupported) { + this.accessoryKeypadSupported = accessoryKeypadSupported; + return this; + } + + /** + *

Indicates whether the device supports online access codes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage onlineAccessCodesSupported(Boolean onlineAccessCodesSupported) { + this.onlineAccessCodesSupported = Optional.of(onlineAccessCodesSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "online_access_codes_supported", nulls = Nulls.SKIP) + public _FinalStage onlineAccessCodesSupported(Optional onlineAccessCodesSupported) { + this.onlineAccessCodesSupported = onlineAccessCodesSupported; + return this; + } + + /** + *

Indicates whether the device supports offline access codes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage offlineAccessCodesSupported(Boolean offlineAccessCodesSupported) { + this.offlineAccessCodesSupported = Optional.of(offlineAccessCodesSupported); + return this; + } + + @java.lang.Override + @JsonSetter(value = "offline_access_codes_supported", nulls = Nulls.SKIP) + public _FinalStage offlineAccessCodesSupported(Optional offlineAccessCodesSupported) { + this.offlineAccessCodesSupported = offlineAccessCodesSupported; + return this; + } + + /** + *

Indicates whether the device has a built in accessory keypad.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hasBuiltInKeypad(Boolean hasBuiltInKeypad) { + this.hasBuiltInKeypad = Optional.of(hasBuiltInKeypad); + return this; + } + + @java.lang.Override + @JsonSetter(value = "has_built_in_keypad", nulls = Nulls.SKIP) + public _FinalStage hasBuiltInKeypad(Optional hasBuiltInKeypad) { + this.hasBuiltInKeypad = hasBuiltInKeypad; + return this; + } + + /** + *

Indicates whether the device can connect a accessory keypad.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage canConnectAccessoryKeypad(Boolean canConnectAccessoryKeypad) { + this.canConnectAccessoryKeypad = Optional.of(canConnectAccessoryKeypad); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_connect_accessory_keypad", nulls = Nulls.SKIP) + public _FinalStage canConnectAccessoryKeypad(Optional canConnectAccessoryKeypad) { + this.canConnectAccessoryKeypad = canConnectAccessoryKeypad; + return this; + } + + @java.lang.Override public UnmanagedDevicePropertiesModel build() { - return new UnmanagedDevicePropertiesModel(displayName, additionalProperties); + return new UnmanagedDevicePropertiesModel( + canConnectAccessoryKeypad, + displayName, + manufacturerDisplayName, + hasBuiltInKeypad, + offlineAccessCodesSupported, + onlineAccessCodesSupported, + accessoryKeypadSupported, + additionalProperties); } } } diff --git a/src/main/java/com/seam/api/types/UnmanagedDeviceWarningsItem.java b/src/main/java/com/seam/api/types/UnmanagedDeviceWarningsItem.java index d802828..ca8bcdf 100644 --- a/src/main/java/com/seam/api/types/UnmanagedDeviceWarningsItem.java +++ b/src/main/java/com/seam/api/types/UnmanagedDeviceWarningsItem.java @@ -40,7 +40,7 @@ public String getMessage() { return message; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof UnmanagedDeviceWarningsItem && equalTo((UnmanagedDeviceWarningsItem) other); @@ -55,12 +55,12 @@ private boolean equalTo(UnmanagedDeviceWarningsItem other) { return warningCode.equals(other.warningCode) && message.equals(other.message); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.warningCode, this.message); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -94,28 +94,28 @@ public static final class Builder implements WarningCodeStage, MessageStage, _Fi private Builder() {} - @Override + @java.lang.Override public Builder from(UnmanagedDeviceWarningsItem other) { warningCode(other.getWarningCode()); message(other.getMessage()); return this; } - @Override + @java.lang.Override @JsonSetter("warning_code") public MessageStage warningCode(String warningCode) { this.warningCode = warningCode; return this; } - @Override + @java.lang.Override @JsonSetter("message") public _FinalStage message(String message) { this.message = message; return this; } - @Override + @java.lang.Override public UnmanagedDeviceWarningsItem build() { return new UnmanagedDeviceWarningsItem(warningCode, message, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/UnmanagedListResponseAccessCodesItem.java b/src/main/java/com/seam/api/types/UnmanagedListResponseAccessCodesItem.java deleted file mode 100644 index 21717ce..0000000 --- a/src/main/java/com/seam/api/types/UnmanagedListResponseAccessCodesItem.java +++ /dev/null @@ -1,412 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seam.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seam.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -@JsonDeserialize(builder = UnmanagedListResponseAccessCodesItem.Builder.class) -public final class UnmanagedListResponseAccessCodesItem { - private final UnmanagedListResponseAccessCodesItemType type; - - private final String accessCodeId; - - private final String deviceId; - - private final Optional name; - - private final Optional code; - - private final OffsetDateTime createdAt; - - private final Optional errors; - - private final Optional warnings; - - private final boolean isManaged; - - private final Optional startsAt; - - private final Optional endsAt; - - private final Map additionalProperties; - - private UnmanagedListResponseAccessCodesItem( - UnmanagedListResponseAccessCodesItemType type, - String accessCodeId, - String deviceId, - Optional name, - Optional code, - OffsetDateTime createdAt, - Optional errors, - Optional warnings, - boolean isManaged, - Optional startsAt, - Optional endsAt, - Map additionalProperties) { - this.type = type; - this.accessCodeId = accessCodeId; - this.deviceId = deviceId; - this.name = name; - this.code = code; - this.createdAt = createdAt; - this.errors = errors; - this.warnings = warnings; - this.isManaged = isManaged; - this.startsAt = startsAt; - this.endsAt = endsAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public UnmanagedListResponseAccessCodesItemType getType() { - return type; - } - - @JsonProperty("access_code_id") - public String getAccessCodeId() { - return accessCodeId; - } - - @JsonProperty("device_id") - public String getDeviceId() { - return deviceId; - } - - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("code") - public Optional getCode() { - return code; - } - - @JsonProperty("created_at") - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - @JsonProperty("errors") - public Optional getErrors() { - return errors; - } - - @JsonProperty("warnings") - public Optional getWarnings() { - return warnings; - } - - @JsonProperty("is_managed") - public boolean getIsManaged() { - return isManaged; - } - - @JsonProperty("starts_at") - public Optional getStartsAt() { - return startsAt; - } - - @JsonProperty("ends_at") - public Optional getEndsAt() { - return endsAt; - } - - @JsonProperty("status") - public String getStatus() { - return "set"; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UnmanagedListResponseAccessCodesItem - && equalTo((UnmanagedListResponseAccessCodesItem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UnmanagedListResponseAccessCodesItem other) { - return type.equals(other.type) - && accessCodeId.equals(other.accessCodeId) - && deviceId.equals(other.deviceId) - && name.equals(other.name) - && code.equals(other.code) - && createdAt.equals(other.createdAt) - && errors.equals(other.errors) - && warnings.equals(other.warnings) - && isManaged == other.isManaged - && startsAt.equals(other.startsAt) - && endsAt.equals(other.endsAt); - } - - @Override - public int hashCode() { - return Objects.hash( - this.type, - this.accessCodeId, - this.deviceId, - this.name, - this.code, - this.createdAt, - this.errors, - this.warnings, - this.isManaged, - this.startsAt, - this.endsAt); - } - - @Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TypeStage builder() { - return new Builder(); - } - - public interface TypeStage { - AccessCodeIdStage type(UnmanagedListResponseAccessCodesItemType type); - - Builder from(UnmanagedListResponseAccessCodesItem other); - } - - public interface AccessCodeIdStage { - DeviceIdStage accessCodeId(String accessCodeId); - } - - public interface DeviceIdStage { - CreatedAtStage deviceId(String deviceId); - } - - public interface CreatedAtStage { - IsManagedStage createdAt(OffsetDateTime createdAt); - } - - public interface IsManagedStage { - _FinalStage isManaged(boolean isManaged); - } - - public interface _FinalStage { - UnmanagedListResponseAccessCodesItem build(); - - _FinalStage name(Optional name); - - _FinalStage name(String name); - - _FinalStage code(Optional code); - - _FinalStage code(String code); - - _FinalStage errors(Optional errors); - - _FinalStage errors(Object errors); - - _FinalStage warnings(Optional warnings); - - _FinalStage warnings(Object warnings); - - _FinalStage startsAt(Optional startsAt); - - _FinalStage startsAt(OffsetDateTime startsAt); - - _FinalStage endsAt(Optional endsAt); - - _FinalStage endsAt(OffsetDateTime endsAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements TypeStage, AccessCodeIdStage, DeviceIdStage, CreatedAtStage, IsManagedStage, _FinalStage { - private UnmanagedListResponseAccessCodesItemType type; - - private String accessCodeId; - - private String deviceId; - - private OffsetDateTime createdAt; - - private boolean isManaged; - - private Optional endsAt = Optional.empty(); - - private Optional startsAt = Optional.empty(); - - private Optional warnings = Optional.empty(); - - private Optional errors = Optional.empty(); - - private Optional code = Optional.empty(); - - private Optional name = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @Override - public Builder from(UnmanagedListResponseAccessCodesItem other) { - type(other.getType()); - accessCodeId(other.getAccessCodeId()); - deviceId(other.getDeviceId()); - name(other.getName()); - code(other.getCode()); - createdAt(other.getCreatedAt()); - errors(other.getErrors()); - warnings(other.getWarnings()); - isManaged(other.getIsManaged()); - startsAt(other.getStartsAt()); - endsAt(other.getEndsAt()); - return this; - } - - @Override - @JsonSetter("type") - public AccessCodeIdStage type(UnmanagedListResponseAccessCodesItemType type) { - this.type = type; - return this; - } - - @Override - @JsonSetter("access_code_id") - public DeviceIdStage accessCodeId(String accessCodeId) { - this.accessCodeId = accessCodeId; - return this; - } - - @Override - @JsonSetter("device_id") - public CreatedAtStage deviceId(String deviceId) { - this.deviceId = deviceId; - return this; - } - - @Override - @JsonSetter("created_at") - public IsManagedStage createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - @Override - @JsonSetter("is_managed") - public _FinalStage isManaged(boolean isManaged) { - this.isManaged = isManaged; - return this; - } - - @Override - public _FinalStage endsAt(OffsetDateTime endsAt) { - this.endsAt = Optional.of(endsAt); - return this; - } - - @Override - @JsonSetter(value = "ends_at", nulls = Nulls.SKIP) - public _FinalStage endsAt(Optional endsAt) { - this.endsAt = endsAt; - return this; - } - - @Override - public _FinalStage startsAt(OffsetDateTime startsAt) { - this.startsAt = Optional.of(startsAt); - return this; - } - - @Override - @JsonSetter(value = "starts_at", nulls = Nulls.SKIP) - public _FinalStage startsAt(Optional startsAt) { - this.startsAt = startsAt; - return this; - } - - @Override - public _FinalStage warnings(Object warnings) { - this.warnings = Optional.of(warnings); - return this; - } - - @Override - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public _FinalStage warnings(Optional warnings) { - this.warnings = warnings; - return this; - } - - @Override - public _FinalStage errors(Object errors) { - this.errors = Optional.of(errors); - return this; - } - - @Override - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public _FinalStage errors(Optional errors) { - this.errors = errors; - return this; - } - - @Override - public _FinalStage code(String code) { - this.code = Optional.of(code); - return this; - } - - @Override - @JsonSetter(value = "code", nulls = Nulls.SKIP) - public _FinalStage code(Optional code) { - this.code = code; - return this; - } - - @Override - public _FinalStage name(String name) { - this.name = Optional.of(name); - return this; - } - - @Override - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public _FinalStage name(Optional name) { - this.name = name; - return this; - } - - @Override - public UnmanagedListResponseAccessCodesItem build() { - return new UnmanagedListResponseAccessCodesItem( - type, - accessCodeId, - deviceId, - name, - code, - createdAt, - errors, - warnings, - isManaged, - startsAt, - endsAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/seam/api/types/UserIdentity.java b/src/main/java/com/seam/api/types/UserIdentity.java new file mode 100644 index 0000000..c2078f4 --- /dev/null +++ b/src/main/java/com/seam/api/types/UserIdentity.java @@ -0,0 +1,316 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.seam.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.seam.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonDeserialize(builder = UserIdentity.Builder.class) +public final class UserIdentity { + private final String userIdentityId; + + private final Optional userIdentityKey; + + private final Optional emailAddress; + + private final Optional phoneNumber; + + private final String displayName; + + private final Optional fullName; + + private final OffsetDateTime createdAt; + + private final String workspaceId; + + private final Map additionalProperties; + + private UserIdentity( + String userIdentityId, + Optional userIdentityKey, + Optional emailAddress, + Optional phoneNumber, + String displayName, + Optional fullName, + OffsetDateTime createdAt, + String workspaceId, + Map additionalProperties) { + this.userIdentityId = userIdentityId; + this.userIdentityKey = userIdentityKey; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.displayName = displayName; + this.fullName = fullName; + this.createdAt = createdAt; + this.workspaceId = workspaceId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("user_identity_id") + public String getUserIdentityId() { + return userIdentityId; + } + + @JsonProperty("user_identity_key") + public Optional getUserIdentityKey() { + return userIdentityKey; + } + + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + @JsonProperty("display_name") + public String getDisplayName() { + return displayName; + } + + @JsonProperty("full_name") + public Optional getFullName() { + return fullName; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("workspace_id") + public String getWorkspaceId() { + return workspaceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserIdentity && equalTo((UserIdentity) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserIdentity other) { + return userIdentityId.equals(other.userIdentityId) + && userIdentityKey.equals(other.userIdentityKey) + && emailAddress.equals(other.emailAddress) + && phoneNumber.equals(other.phoneNumber) + && displayName.equals(other.displayName) + && fullName.equals(other.fullName) + && createdAt.equals(other.createdAt) + && workspaceId.equals(other.workspaceId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.userIdentityId, + this.userIdentityKey, + this.emailAddress, + this.phoneNumber, + this.displayName, + this.fullName, + this.createdAt, + this.workspaceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UserIdentityIdStage builder() { + return new Builder(); + } + + public interface UserIdentityIdStage { + DisplayNameStage userIdentityId(String userIdentityId); + + Builder from(UserIdentity other); + } + + public interface DisplayNameStage { + CreatedAtStage displayName(String displayName); + } + + public interface CreatedAtStage { + WorkspaceIdStage createdAt(OffsetDateTime createdAt); + } + + public interface WorkspaceIdStage { + _FinalStage workspaceId(String workspaceId); + } + + public interface _FinalStage { + UserIdentity build(); + + _FinalStage userIdentityKey(Optional userIdentityKey); + + _FinalStage userIdentityKey(String userIdentityKey); + + _FinalStage emailAddress(Optional emailAddress); + + _FinalStage emailAddress(String emailAddress); + + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + _FinalStage fullName(Optional fullName); + + _FinalStage fullName(String fullName); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements UserIdentityIdStage, DisplayNameStage, CreatedAtStage, WorkspaceIdStage, _FinalStage { + private String userIdentityId; + + private String displayName; + + private OffsetDateTime createdAt; + + private String workspaceId; + + private Optional fullName = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional userIdentityKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UserIdentity other) { + userIdentityId(other.getUserIdentityId()); + userIdentityKey(other.getUserIdentityKey()); + emailAddress(other.getEmailAddress()); + phoneNumber(other.getPhoneNumber()); + displayName(other.getDisplayName()); + fullName(other.getFullName()); + createdAt(other.getCreatedAt()); + workspaceId(other.getWorkspaceId()); + return this; + } + + @java.lang.Override + @JsonSetter("user_identity_id") + public DisplayNameStage userIdentityId(String userIdentityId) { + this.userIdentityId = userIdentityId; + return this; + } + + @java.lang.Override + @JsonSetter("display_name") + public CreatedAtStage displayName(String displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public WorkspaceIdStage createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("workspace_id") + public _FinalStage workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + @java.lang.Override + public _FinalStage fullName(String fullName) { + this.fullName = Optional.of(fullName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "full_name", nulls = Nulls.SKIP) + public _FinalStage fullName(Optional fullName) { + this.fullName = fullName; + return this; + } + + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.of(phoneNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + @java.lang.Override + public _FinalStage emailAddress(String emailAddress) { + this.emailAddress = Optional.of(emailAddress); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public _FinalStage emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + @java.lang.Override + public _FinalStage userIdentityKey(String userIdentityKey) { + this.userIdentityKey = Optional.of(userIdentityKey); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_identity_key", nulls = Nulls.SKIP) + public _FinalStage userIdentityKey(Optional userIdentityKey) { + this.userIdentityKey = userIdentityKey; + return this; + } + + @java.lang.Override + public UserIdentity build() { + return new UserIdentity( + userIdentityId, + userIdentityKey, + emailAddress, + phoneNumber, + displayName, + fullName, + createdAt, + workspaceId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/seam/api/types/Webhook.java b/src/main/java/com/seam/api/types/Webhook.java index f318318..15774aa 100644 --- a/src/main/java/com/seam/api/types/Webhook.java +++ b/src/main/java/com/seam/api/types/Webhook.java @@ -64,7 +64,7 @@ public Optional getSecret() { return secret; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Webhook && equalTo((Webhook) other); @@ -82,12 +82,12 @@ private boolean equalTo(Webhook other) { && secret.equals(other.secret); } - @Override + @java.lang.Override public int hashCode() { return Objects.hash(this.webhookId, this.url, this.eventTypes, this.secret); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -133,7 +133,7 @@ public static final class Builder implements WebhookIdStage, UrlStage, _FinalSta private Builder() {} - @Override + @java.lang.Override public Builder from(Webhook other) { webhookId(other.getWebhookId()); url(other.getUrl()); @@ -142,47 +142,47 @@ public Builder from(Webhook other) { return this; } - @Override + @java.lang.Override @JsonSetter("webhook_id") public UrlStage webhookId(String webhookId) { this.webhookId = webhookId; return this; } - @Override + @java.lang.Override @JsonSetter("url") public _FinalStage url(String url) { this.url = url; return this; } - @Override + @java.lang.Override public _FinalStage secret(String secret) { this.secret = Optional.of(secret); return this; } - @Override + @java.lang.Override @JsonSetter(value = "secret", nulls = Nulls.SKIP) public _FinalStage secret(Optional secret) { this.secret = secret; return this; } - @Override + @java.lang.Override public _FinalStage eventTypes(List eventTypes) { this.eventTypes = Optional.of(eventTypes); return this; } - @Override + @java.lang.Override @JsonSetter(value = "event_types", nulls = Nulls.SKIP) public _FinalStage eventTypes(Optional> eventTypes) { this.eventTypes = eventTypes; return this; } - @Override + @java.lang.Override public Webhook build() { return new Webhook(webhookId, url, eventTypes, secret, additionalProperties); } diff --git a/src/main/java/com/seam/api/types/Workspace.java b/src/main/java/com/seam/api/types/Workspace.java index a79749f..3d746e1 100644 --- a/src/main/java/com/seam/api/types/Workspace.java +++ b/src/main/java/com/seam/api/types/Workspace.java @@ -24,6 +24,8 @@ public final class Workspace { private final String name; + private final String companyName; + private final boolean isSandbox; private final Optional connectPartnerName; @@ -33,11 +35,13 @@ public final class Workspace { private Workspace( String workspaceId, String name, + String companyName, boolean isSandbox, Optional connectPartnerName, Map additionalProperties) { this.workspaceId = workspaceId; this.name = name; + this.companyName = companyName; this.isSandbox = isSandbox; this.connectPartnerName = connectPartnerName; this.additionalProperties = additionalProperties; @@ -53,6 +57,11 @@ public String getName() { return name; } + @JsonProperty("company_name") + public String getCompanyName() { + return companyName; + } + @JsonProperty("is_sandbox") public boolean getIsSandbox() { return isSandbox; @@ -63,7 +72,7 @@ public Optional getConnectPartnerName() { return connectPartnerName; } - @Override + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Workspace && equalTo((Workspace) other); @@ -77,16 +86,17 @@ public Map getAdditionalProperties() { private boolean equalTo(Workspace other) { return workspaceId.equals(other.workspaceId) && name.equals(other.name) + && companyName.equals(other.companyName) && isSandbox == other.isSandbox && connectPartnerName.equals(other.connectPartnerName); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(this.workspaceId, this.name, this.isSandbox, this.connectPartnerName); + return Objects.hash(this.workspaceId, this.name, this.companyName, this.isSandbox, this.connectPartnerName); } - @Override + @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } @@ -102,7 +112,11 @@ public interface WorkspaceIdStage { } public interface NameStage { - IsSandboxStage name(String name); + CompanyNameStage name(String name); + } + + public interface CompanyNameStage { + IsSandboxStage companyName(String companyName); } public interface IsSandboxStage { @@ -118,11 +132,14 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements WorkspaceIdStage, NameStage, IsSandboxStage, _FinalStage { + public static final class Builder + implements WorkspaceIdStage, NameStage, CompanyNameStage, IsSandboxStage, _FinalStage { private String workspaceId; private String name; + private String companyName; + private boolean isSandbox; private Optional connectPartnerName = Optional.empty(); @@ -132,52 +149,60 @@ public static final class Builder implements WorkspaceIdStage, NameStage, IsSand private Builder() {} - @Override + @java.lang.Override public Builder from(Workspace other) { workspaceId(other.getWorkspaceId()); name(other.getName()); + companyName(other.getCompanyName()); isSandbox(other.getIsSandbox()); connectPartnerName(other.getConnectPartnerName()); return this; } - @Override + @java.lang.Override @JsonSetter("workspace_id") public NameStage workspaceId(String workspaceId) { this.workspaceId = workspaceId; return this; } - @Override + @java.lang.Override @JsonSetter("name") - public IsSandboxStage name(String name) { + public CompanyNameStage name(String name) { this.name = name; return this; } - @Override + @java.lang.Override + @JsonSetter("company_name") + public IsSandboxStage companyName(String companyName) { + this.companyName = companyName; + return this; + } + + @java.lang.Override @JsonSetter("is_sandbox") public _FinalStage isSandbox(boolean isSandbox) { this.isSandbox = isSandbox; return this; } - @Override + @java.lang.Override public _FinalStage connectPartnerName(String connectPartnerName) { this.connectPartnerName = Optional.of(connectPartnerName); return this; } - @Override + @java.lang.Override @JsonSetter(value = "connect_partner_name", nulls = Nulls.SKIP) public _FinalStage connectPartnerName(Optional connectPartnerName) { this.connectPartnerName = connectPartnerName; return this; } - @Override + @java.lang.Override public Workspace build() { - return new Workspace(workspaceId, name, isSandbox, connectPartnerName, additionalProperties); + return new Workspace(workspaceId, name, companyName, isSandbox, connectPartnerName, additionalProperties); } } } From 23a51ae9e0cce7c437356ae362451e6af9e0c9fa Mon Sep 17 00:00:00 2001 From: Dan Burke Date: Mon, 8 Jul 2024 12:49:47 -0400 Subject: [PATCH 2/2] Fix tests (#30) --- .gitignore | 1 + src/main/java/com/seam/api/SeamBuilder.java | 42 ------------------- .../types/ConnectedAccountsGetRequest.java | 8 ++++ .../ConnectWebviewsClient.java | 6 +++ .../seam/api/accesscode/AccessCodesTest.java | 6 ++- .../api/actionattempt/ActionAttemptsTest.java | 3 +- .../ConnectedAccountsTest.java | 2 +- .../connectwebview/ConnectWebviewsTest.java | 2 +- 8 files changed, 23 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index d4199ab..7570ee8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ .settings .node build +src/main/java/com/seam/api/SeamBuilder.java # IntelliJ *.iml diff --git a/src/main/java/com/seam/api/SeamBuilder.java b/src/main/java/com/seam/api/SeamBuilder.java index 9f6790b..05a0bed 100644 --- a/src/main/java/com/seam/api/SeamBuilder.java +++ b/src/main/java/com/seam/api/SeamBuilder.java @@ -11,12 +11,6 @@ public final class SeamBuilder { private String apiKey = null; - private String seamWorkspace = null; - - private String seamClientSessionToken = null; - - private String clientSessionToken = null; - private Environment environment = Environment.DEFAULT; /** @@ -27,30 +21,6 @@ public SeamBuilder apiKey(String apiKey) { return this; } - /** - * Sets seamWorkspace - */ - public SeamBuilder seamWorkspace(String seamWorkspace) { - this.seamWorkspace = seamWorkspace; - return this; - } - - /** - * Sets seamClientSessionToken - */ - public SeamBuilder seamClientSessionToken(String seamClientSessionToken) { - this.seamClientSessionToken = seamClientSessionToken; - return this; - } - - /** - * Sets clientSessionToken - */ - public SeamBuilder clientSessionToken(String clientSessionToken) { - this.clientSessionToken = clientSessionToken; - return this; - } - public SeamBuilder environment(Environment environment) { this.environment = environment; return this; @@ -63,18 +33,6 @@ public SeamBuilder url(String url) { public Seam build() { this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.apiKey); - if (seamWorkspace == null) { - throw new RuntimeException("Please provide seamWorkspace"); - } - this.clientOptionsBuilder.addHeader("seam-workspace", this.seamWorkspace); - if (seamClientSessionToken == null) { - throw new RuntimeException("Please provide seamClientSessionToken"); - } - this.clientOptionsBuilder.addHeader("seam-client-session-token", this.seamClientSessionToken); - if (clientSessionToken == null) { - throw new RuntimeException("Please provide clientSessionToken"); - } - this.clientOptionsBuilder.addHeader("client-session-token", this.clientSessionToken); clientOptionsBuilder.environment(this.environment); return new Seam(clientOptionsBuilder.build()); } diff --git a/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsGetRequest.java b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsGetRequest.java index e80780d..96ec080 100644 --- a/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsGetRequest.java +++ b/src/main/java/com/seam/api/resources/connectedaccounts/types/ConnectedAccountsGetRequest.java @@ -66,6 +66,14 @@ public static ConnectedAccountsGetRequest of(ConnectedAccountsGetRequestEmail va return new ConnectedAccountsGetRequest(value, 1); } + public static ConnectedAccountsGetRequest id(String id) { + return new ConnectedAccountsGetRequest( + ConnectedAccountsGetRequestConnectedAccountId.builder() + .connectedAccountId(id) + .build(), + 0); + } + public interface Visitor { T visit(ConnectedAccountsGetRequestConnectedAccountId value); diff --git a/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java b/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java index df2b87f..fe95bf5 100644 --- a/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java +++ b/src/main/java/com/seam/api/resources/connectwebviews/ConnectWebviewsClient.java @@ -154,6 +154,12 @@ public ConnectWebview get(ConnectWebviewsGetRequest request) { return get(request, null); } + public ConnectWebview getById(String connectWebviewId) { + return get(ConnectWebviewsGetRequest.builder() + .connectWebviewId(connectWebviewId) + .build()); + } + public ConnectWebview get(ConnectWebviewsGetRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() diff --git a/src/test/java/com/seam/api/accesscode/AccessCodesTest.java b/src/test/java/com/seam/api/accesscode/AccessCodesTest.java index 821a38a..ac60f34 100644 --- a/src/test/java/com/seam/api/accesscode/AccessCodesTest.java +++ b/src/test/java/com/seam/api/accesscode/AccessCodesTest.java @@ -1,5 +1,6 @@ package com.seam.api.accesscode; +import com.seam.api.resources.accesscodes.types.AccessCodesDeleteResponse; import java.util.List; import java.util.stream.Collectors; @@ -118,11 +119,12 @@ public void test_access_codes() { // .build()); // Assertions.assertThat(accessCode.getType()).isEqualTo(AccessCodeType.TIME_BOUND); - ActionAttempt deleteActionAttempt = seam.accessCodes() + AccessCodesDeleteResponse deleteActionAttempt = seam.accessCodes() .delete(AccessCodesDeleteRequest.builder() .accessCodeId(createdAccessCode.getAccessCodeId()) .build()); - Assertions.assertThat(deleteActionAttempt.isSuccess()); + Assertions.assertThat(deleteActionAttempt).isNotNull(); + Assertions.assertThat(deleteActionAttempt.getActionAttempt()).isNotNull(); accessCodes = seam.accessCodes() .createMultiple(AccessCodesCreateMultipleRequest.builder() diff --git a/src/test/java/com/seam/api/actionattempt/ActionAttemptsTest.java b/src/test/java/com/seam/api/actionattempt/ActionAttemptsTest.java index 3c713d3..68a5db0 100644 --- a/src/test/java/com/seam/api/actionattempt/ActionAttemptsTest.java +++ b/src/test/java/com/seam/api/actionattempt/ActionAttemptsTest.java @@ -5,6 +5,7 @@ import com.seam.api.TestUtils.FakeSeamStartedResponse; import com.seam.api.resources.accesscodes.requests.AccessCodesCreateRequest; import com.seam.api.resources.accesscodes.requests.AccessCodesDeleteRequest; +import com.seam.api.resources.accesscodes.types.AccessCodesDeleteResponse; import com.seam.api.types.AccessCode; import com.seam.api.types.ActionAttempt; import com.seam.api.types.Device; @@ -41,7 +42,7 @@ public void test_access_attempts() { .code("4444") .build()); - ActionAttempt deleteActionAttempt = seam.accessCodes() + AccessCodesDeleteResponse deleteActionAttempt = seam.accessCodes() .delete(AccessCodesDeleteRequest.builder() .accessCodeId(createdAccessCode.getAccessCodeId()) .build()); diff --git a/src/test/java/com/seam/api/connectedaccounts/ConnectedAccountsTest.java b/src/test/java/com/seam/api/connectedaccounts/ConnectedAccountsTest.java index 040a006..5302a70 100644 --- a/src/test/java/com/seam/api/connectedaccounts/ConnectedAccountsTest.java +++ b/src/test/java/com/seam/api/connectedaccounts/ConnectedAccountsTest.java @@ -1,5 +1,6 @@ package com.seam.api.connectedaccounts; +import com.seam.api.resources.connectedaccounts.types.ConnectedAccountsGetRequest; import java.util.List; import org.assertj.core.api.Assertions; @@ -11,7 +12,6 @@ import com.seam.api.TestUtils; import com.seam.api.TestUtils.FakeSeamStartedResponse; import com.seam.api.types.ConnectedAccount; -import com.seam.api.types.ConnectedAccountsGetRequest; public final class ConnectedAccountsTest { diff --git a/src/test/java/com/seam/api/connectwebview/ConnectWebviewsTest.java b/src/test/java/com/seam/api/connectwebview/ConnectWebviewsTest.java index 01f31c6..bf0b1bb 100644 --- a/src/test/java/com/seam/api/connectwebview/ConnectWebviewsTest.java +++ b/src/test/java/com/seam/api/connectwebview/ConnectWebviewsTest.java @@ -5,7 +5,7 @@ import com.seam.api.TestUtils.FakeSeamStartedResponse; import com.seam.api.resources.connectwebviews.requests.ConnectWebviewsCreateRequest; import com.seam.api.resources.connectwebviews.requests.ConnectWebviewsGetRequest; -import com.seam.api.types.AcceptedProvider; +import com.seam.api.resources.connectwebviews.types.AcceptedProvider; import com.seam.api.types.ConnectWebview; import com.seam.api.types.ProviderCategory; import java.util.List;