def METHOD_NAME(client, sample_service):
    data = {"notification_type": "sms", "days_of_retention": 3}
    response = client.post(
        "/service/{}/data-retention".format(str(sample_service.id)),
        headers=[("Content-Type", "application/json"), create_authorization_header()],
        data=json.dumps(data),
    )
    assert response.status_code == 201
    json_resp = json.loads(response.get_data(as_text=True))["result"]
    results = ServiceDataRetention.query.all()
    assert len(results) == 1
    data_retention = results[0]
    assert json_resp == data_retention.serialize()