001package ca.uhn.fhir.jpa.bulk.export.model; 002 003/*- 004 * #%L 005 * HAPI FHIR Storage api 006 * %% 007 * Copyright (C) 2014 - 2022 Smile CDR, Inc. 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023 024import ca.uhn.fhir.jpa.util.JsonDateDeserializer; 025import ca.uhn.fhir.jpa.util.JsonDateSerializer; 026import ca.uhn.fhir.model.api.IModelJson; 027import com.fasterxml.jackson.annotation.JsonAutoDetect; 028import com.fasterxml.jackson.annotation.JsonInclude; 029import com.fasterxml.jackson.annotation.JsonProperty; 030import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 031import com.fasterxml.jackson.databind.annotation.JsonSerialize; 032 033import java.util.ArrayList; 034import java.util.Date; 035import java.util.List; 036 037@JsonInclude(JsonInclude.Include.NON_DEFAULT) 038@JsonAutoDetect(creatorVisibility = JsonAutoDetect.Visibility.NONE, fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE) 039public class BulkExportResponseJson { 040 041 @JsonProperty("transactionTime") 042 @JsonSerialize(using = JsonDateSerializer.class) 043 @JsonDeserialize(using = JsonDateDeserializer.class) 044 private Date myTransactionTime; 045 046 @JsonProperty("request") 047 private String myRequest; 048 @JsonProperty("requiresAccessToken") 049 private Boolean myRequiresAccessToken; 050 @JsonProperty("output") 051 private List<Output> myOutput; 052 @JsonProperty("error") 053 private List<Output> myError; 054 055 public Date getTransactionTime() { 056 return myTransactionTime; 057 } 058 059 public BulkExportResponseJson setTransactionTime(Date theTransactionTime) { 060 myTransactionTime = theTransactionTime; 061 return this; 062 } 063 064 public String getRequest() { 065 return myRequest; 066 } 067 068 public BulkExportResponseJson setRequest(String theRequest) { 069 myRequest = theRequest; 070 return this; 071 } 072 073 public Boolean getRequiresAccessToken() { 074 return myRequiresAccessToken; 075 } 076 077 public BulkExportResponseJson setRequiresAccessToken(Boolean theRequiresAccessToken) { 078 myRequiresAccessToken = theRequiresAccessToken; 079 return this; 080 } 081 082 public List<Output> getOutput() { 083 if (myOutput == null) { 084 myOutput = new ArrayList<>(); 085 } 086 return myOutput; 087 } 088 089 public List<Output> getError() { 090 if (myError == null) { 091 myError = new ArrayList<>(); 092 } 093 return myError; 094 } 095 096 public Output addOutput() { 097 Output retVal = new Output(); 098 getOutput().add(retVal); 099 return retVal; 100 } 101 102 public static class Output implements IModelJson { 103 104 @JsonProperty("type") 105 private String myType; 106 @JsonProperty("url") 107 private String myUrl; 108 109 public String getType() { 110 return myType; 111 } 112 113 public Output setType(String theType) { 114 myType = theType; 115 return this; 116 } 117 118 public String getUrl() { 119 return myUrl; 120 } 121 122 public Output setUrl(String theUrl) { 123 myUrl = theUrl; 124 return this; 125 } 126 127 } 128 129}