public static async Task <HttpResponseMessage> SendAssignBasisForTransferRequestAsync(int registrationId, int basisForTransferId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{registrationId}/basis-for-transfer/assign"), cookie, new SingleValueDTO <int> { Value = basisForTransferId })); }
public static async Task <HttpResponseMessage> SendSetMasterReferenceRequestAsync(int id, int refId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new { Value = refId }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/master-reference"), cookie, body)); }
public static async Task <HttpResponseMessage> SendPatchRelationRequestAsync(SystemRelationDTO input, Cookie login = null) { login = login ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl("api/v1/systemrelations"); return(await HttpApi.PatchWithCookieAsync(url, login, input)); }
public static async Task <HttpResponseMessage> SendRemoveInsecureThirdCountryRequestAsync(int registrationId, int countryId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{registrationId}/insecure-third-countries/remove"), cookie, new SingleValueDTO <int> { Value = countryId })); }
public static async Task <HttpResponseMessage> SendRemoveRoleRequestAsync(int id, int roleId, int userId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync( TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/roles/remove/{roleId}/from/{userId}"), cookie, new { })); }
public static async Task <HttpResponseMessage> SendSetUseTransferToInsecureThirdCountriesStateRequestAsync(int registrationId, YesNoUndecidedOption value, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{registrationId}/insecure-third-countries/state"), cookie, new SingleValueDTO <YesNoUndecidedOption> { Value = value })); }
public static async Task <HttpResponseMessage> SendRemoveOversightDateRequestAsync(int id, int oversightDateId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new SingleValueDTO <int> { Value = oversightDateId }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/oversight-date/remove"), cookie, body)); }
public static async Task <HttpResponseMessage> SendChangeOversightIntervalOptionRemarkRequestAsync(int id, string remark, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new SingleValueDTO <string> { Value = remark }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/oversight-interval-remark"), cookie, body)); }
public static async Task <ItContractDTO> PatchContract(int contractId, int orgId, object body) { var cookie = await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); using (var okResponse = await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"/api/itcontract/{contractId}?organizationId={orgId}"), cookie, body)) { Assert.Equal(HttpStatusCode.OK, okResponse.StatusCode); return(await okResponse.ReadResponseBodyAsKitosApiResponseAsync <ItContractDTO>()); } }
public static async Task <ItSystemUsageSensitiveDataLevelDTO> RemoveSensitiveDataLevel(int systemUsageId, SensitiveDataLevel sensitiveDataLevel) { var cookie = await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); using (var okResponse = await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/itsystemusage/{systemUsageId}/sensitivityLevel/remove"), cookie, sensitiveDataLevel)) { Assert.Equal(HttpStatusCode.OK, okResponse.StatusCode); return(await okResponse.ReadResponseBodyAsKitosApiResponseAsync <ItSystemUsageSensitiveDataLevelDTO>()); } }
public static async Task <HttpResponseMessage> SendModifyOversightDateRequestAsync(int id, int oversightDateId, DateTime dateTime, string remark, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new DataProcessingRegistrationOversightDateDTO { Id = oversightDateId, OversightDate = dateTime, OversightRemark = remark }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/oversight-date/modify"), cookie, body)); }
public static async Task <HttpResponseMessage> SendChangeAgreementConcludedAtRequestAsync(int id, DateTime?dateTime, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new SingleValueDTO <DateTime?> { Value = dateTime }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/agreement-concluded-at"), cookie, body)); }
public static async Task <ItInterfaceDTO> SetUrlAsync(int interfaceId, string url, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); using (var response = await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/itinterface/{interfaceId}?{KitosApiConstants.UnusedOrganizationIdParameter}"), cookie, new { url = url })) { Assert.Equal(HttpStatusCode.OK, response.StatusCode); return(await response.ReadResponseBodyAsKitosApiResponseAsync <ItInterfaceDTO>()); } }
public static async Task <HttpResponseMessage> SendAssignDataResponsibleRequestAsync(int id, int?dataResponsibleOptionId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new SingleValueDTO <int?> { Value = dataResponsibleOptionId }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/data-responsible/assign"), cookie, body)); }
public static async Task <HttpResponseMessage> SendChangeIsOversightCompletedRequestAsync(int id, YesNoUndecidedOption?yesNoUndecidedOption, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new SingleValueDTO <YesNoUndecidedOption?> { Value = yesNoUndecidedOption }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/oversight-completed"), cookie, body)); }
public static async Task <HttpResponseMessage> SendUpdateConfigRequestAsync( object body, int orgId, Cookie optionalCookie = null) { var cookie = optionalCookie ?? await HttpApi.GetCookieAsync(OrganizationRole.LocalAdmin); var url = TestEnvironment.CreateUrl($"/odata/Configs({orgId})?organizationId={orgId}"); return(await HttpApi.PatchWithCookieAsync(url, cookie, body)); }
public static async Task <HttpResponseMessage> SendChangeArchiveDutyRecommendationCommentRequestAsync(int systemId, string comment) { var cookie = await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl($"api/itsystem/{systemId}?{KitosApiConstants.UnusedOrganizationIdParameter}"); var body = new { archiveDutyComment = comment }; return(await HttpApi.PatchWithCookieAsync(url, cookie, body)); }
public static async Task <HttpResponseMessage> SendSetDisabledRequestAsync(int systemId, bool isDisabled, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl($"odata/ItSystems({systemId})"); var body = new { Disabled = isDisabled }; return(await HttpApi.PatchWithCookieAsync(url, cookie, body)); }
public static async Task <HttpResponseMessage> SendChangeOrganizationNameRequestAsync(int organizationId, string name, int owningOrganizationId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl($"api/organization/{organizationId}?organizationId={owningOrganizationId}"); var body = new { name = name }; return(await HttpApi.PatchWithCookieAsync(url, cookie, body)); }
public static async Task <ItSystemUsageSensitiveDataLevelDTO> SendSetExpirationDateRequestAsync(int systemUsageId, int orgId, DateTime systemUsageExpirationDate) { var cookie = await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new { ExpirationDate = systemUsageExpirationDate }; using (var okResponse = await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/itSystemUsage/{systemUsageId}?organizationId={orgId}"), cookie, body)) { Assert.Equal(HttpStatusCode.OK, okResponse.StatusCode); return(await okResponse.ReadResponseBodyAsKitosApiResponseAsync <ItSystemUsageSensitiveDataLevelDTO>()); } }
public static async Task <HttpResponseMessage> SendChangeContactPersonRequestAsync(int contactPersonId, int organizationId, string name, string lastName, string email, string phone, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var body = new { organizationId = organizationId, name = name, email = email, lastName = lastName, phoneNumber = phone }; return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/contactPerson/{contactPersonId}?organizationId={organizationId}"), cookie, body)); }
public static async Task <HttpResponseMessage> SetIsHoldingDocumentRequestAsync(int systemUsageId, bool isDocumentHolding, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl($"odata/ItSystemUsages({systemUsageId})"); var body = new { Registertype = isDocumentHolding }; using var response = await HttpApi.PatchWithCookieAsync(url, cookie, body); Assert.Equal(HttpStatusCode.NoContent, response.StatusCode); return(response); }
public static async Task <HttpResponseMessage> SendChangeNameRequestAsync(int projectId, string newName, int organizationId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl($"api/itproject/{projectId}?organizationId={organizationId}"); var body = new { name = newName }; using (var updatedResponse = await HttpApi.PatchWithCookieAsync(url, cookie, body)) { Assert.Equal(HttpStatusCode.OK, updatedResponse.StatusCode); return(updatedResponse); } }
public static async Task <HttpResponseMessage> SendChangeBusinessTypeIsObligatoryAsync(int businessTypeId, bool isObligatory, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl($"odata/BusinessTypes({businessTypeId})"); var body = new { IsObligatory = isObligatory }; using var response = await HttpApi.PatchWithCookieAsync(url, cookie, body); Assert.Equal(HttpStatusCode.NoContent, response.StatusCode); return(response); }
public static async Task <HttpResponseMessage> SendSetBelongsToRequestAsync( int systemId, int belongsToId, int organizationId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl($"api/itsystem/{systemId}?organizationId={organizationId}"); var body = new { belongsToId = belongsToId }; return(await HttpApi.PatchWithCookieAsync(url, cookie, body)); }
public static async Task <HttpResponseMessage> SendRemoveSystemRequestAsync(int registrationId, int systemId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{registrationId}/it-systems/remove"), cookie, new { Value = systemId })); }
public static async Task <HttpResponseMessage> SendRemoveDataProcessingRegistrationAsync(int contractId, int registrationId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/itcontract/{contractId}/data-processing-registration/remove"), cookie, new { Value = registrationId })); }
public static async Task <HttpResponseMessage> DeactivateAdviceAsync(int adviceId, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"odata/DeactivateAdvice?key={adviceId}"), cookie, null)); }
public static async Task <HttpResponseMessage> SendClearDataResponsibleRequestAsync(int id, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); return(await HttpApi.PatchWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration/{id}/data-responsible/clear"), cookie, null)); }