ConsentResource

Reads and records the signed-in user's consents and requests consent signatures.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.24+fa54770
public final class ConsentResource

Reads and records the signed-in user's consents and requests consent signatures. Get it from Ovok.consent().

Methods

public ConsentResource.LegalConsentResource legal()

Returns the legal (terms and conditions) consent routes.

Returns: the legal consent resource

medical

public ConsentResource.MedicalConsentResource medical()

Returns the medical-notifications consent routes.

Returns: the medical consent resource

requestSignature

public JsonNode requestSignature(String consentId) throws IOException, InterruptedException

Requests a signature for a consent (POST /consent/signature/{consentId}).

Parameters:

  • consentId: the Consent id

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode requestSignature(
        String consentId,
        RequestOptions options) throws IOException, InterruptedException

Requests a signature for a consent (POST /consent/signature/{consentId}).

Parameters:

  • consentId: the Consent id
  • options: per-request options, such as the timeout

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

ConsentResource.LegalConsentResource

public static final class LegalConsentResource

Reads and records the signed-in user's legal consent (/v1/me/consent/legal).

LegalConsentResource.retrieve

public JsonNode retrieve() throws IOException, InterruptedException

Reads the signed-in user's legal consent (GET /v1/me/consent/legal).

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode retrieve(RequestOptions options) throws IOException, InterruptedException

Reads the signed-in user's legal consent (GET /v1/me/consent/legal).

Parameters:

  • options: per-request options, such as the timeout

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

LegalConsentResource.set

public JsonNode set(boolean accepted) throws IOException, InterruptedException

Records whether the signed-in user accepts the legal consent (POST /v1/me/consent/legal).

Parameters:

  • accepted: whether the user accepts; sent as termsAndConditionsConsent

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode set(
        boolean accepted,
        RequestOptions options) throws IOException, InterruptedException

Records whether the signed-in user accepts the legal consent (POST /v1/me/consent/legal).

Parameters:

  • accepted: whether the user accepts; sent as termsAndConditionsConsent
  • options: per-request options, such as the timeout

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

ConsentResource.MedicalConsentResource

public static final class MedicalConsentResource

Reads and records the signed-in user's medical-notifications consent (/v1/me/consent/medical).

MedicalConsentResource.retrieve

public JsonNode retrieve() throws IOException, InterruptedException

Reads the signed-in user's medical-notifications consent (GET /v1/me/consent/medical).

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode retrieve(RequestOptions options) throws IOException, InterruptedException

Reads the signed-in user's medical-notifications consent (GET /v1/me/consent/medical).

Parameters:

  • options: per-request options, such as the timeout

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

MedicalConsentResource.set

public JsonNode set(boolean accepted) throws IOException, InterruptedException

Records whether the signed-in user accepts the medical-notifications consent (POST /v1/me/consent/medical).

Parameters:

  • accepted: whether the user accepts; sent as medicalSettingsNotificationsConsent

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode set(
        boolean accepted,
        RequestOptions options) throws IOException, InterruptedException

Records whether the signed-in user accepts the medical-notifications consent (POST /v1/me/consent/medical).

Parameters:

  • accepted: whether the user accepts; sent as medicalSettingsNotificationsConsent
  • options: per-request options, such as the timeout

Returns: the consent state

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Last updated on

On this page