1 package io.apicurio.registry.maven;
2
3 import io.apicurio.registry.rest.v3.beans.IfArtifactExists;
4 import io.apicurio.registry.types.ArtifactType;
5
6 import java.io.File;
7 import java.util.List;
8
9 public class RegisterArtifact {
10
11 public List<File> getProtoPaths() {
12 return protoPaths;
13 }
14
15 public void setProtoPaths(List<File> protoPaths) {
16 this.protoPaths = protoPaths;
17 }
18
19 public enum AvroAutoRefsNamingStrategy {
20 INHERIT_PARENT_GROUP, USE_AVRO_NAMESPACE
21 }
22
23 private String groupId;
24 private String artifactId;
25 private String version;
26 private String artifactType;
27 private File file;
28 private IfArtifactExists ifExists;
29 private Boolean canonicalize;
30 private Boolean minify;
31 private Boolean autoRefs;
32 private AvroAutoRefsNamingStrategy avroAutoRefsNamingStrategy;
33 private Boolean isDraft;
34 private String contentType;
35 private List<RegisterArtifactReference> references;
36 private List<ExistingReference> existingReferences;
37 private List<File> protoPaths;
38
39
40
41
42 public RegisterArtifact() {
43 }
44
45
46
47
48 public String getGroupId() {
49 return groupId;
50 }
51
52
53
54
55 public void setGroupId(String groupId) {
56 this.groupId = groupId;
57 }
58
59
60
61
62 public String getArtifactId() {
63 return artifactId;
64 }
65
66
67
68
69 public void setArtifactId(String artifactId) {
70 this.artifactId = artifactId;
71 }
72
73
74
75
76 public File getFile() {
77 return file;
78 }
79
80
81
82
83 public void setFile(File file) {
84 this.file = file;
85 }
86
87
88
89
90 public IfArtifactExists getIfExists() {
91 return ifExists;
92 }
93
94
95
96
97 public void setIfExists(IfArtifactExists ifExists) {
98 this.ifExists = ifExists;
99 }
100
101
102
103
104 public Boolean getCanonicalize() {
105 return canonicalize;
106 }
107
108
109
110
111 public void setCanonicalize(Boolean canonicalize) {
112 this.canonicalize = canonicalize;
113 }
114
115
116
117
118 public Boolean getMinify() {
119 return minify;
120 }
121
122
123
124
125 public void setMinify(Boolean minify) {
126 this.minify = minify;
127 }
128
129
130
131
132 public String getArtifactType() {
133 return artifactType;
134 }
135
136
137
138
139 public void setArtifactType(String artifactType) {
140 this.artifactType = artifactType;
141 }
142
143
144
145
146 public String getVersion() {
147 return version;
148 }
149
150
151
152
153 public void setVersion(String version) {
154 this.version = version;
155 }
156
157
158
159
160 public String getContentType() {
161 return contentType;
162 }
163
164
165
166
167 public void setContentType(String contentType) {
168 this.contentType = contentType;
169 }
170
171
172
173
174 public List<RegisterArtifactReference> getReferences() {
175 return references;
176 }
177
178
179
180
181 public void setReferences(List<RegisterArtifactReference> references) {
182 this.references = references;
183 }
184
185 public Boolean getAutoRefs() {
186 return autoRefs;
187 }
188
189 public void setAutoRefs(Boolean autoRefs) {
190 this.autoRefs = autoRefs;
191 }
192
193 public AvroAutoRefsNamingStrategy getAvroAutoRefsNamingStrategy() {
194 if(Boolean.TRUE.equals(autoRefs) && avroAutoRefsNamingStrategy == null) {
195 if(ArtifactType.AVRO.equals(artifactType)) {
196 return AvroAutoRefsNamingStrategy.USE_AVRO_NAMESPACE;
197 }
198 if(ArtifactType.ASYNCAPI.equals(artifactType)) {
199 return AvroAutoRefsNamingStrategy.INHERIT_PARENT_GROUP;
200 }
201 return AvroAutoRefsNamingStrategy.INHERIT_PARENT_GROUP;
202 }
203 return avroAutoRefsNamingStrategy;
204 }
205
206 public void setAvroAutoRefsNamingStrategy(AvroAutoRefsNamingStrategy avroAutoRefsNamingStrategy) {
207 this.avroAutoRefsNamingStrategy = avroAutoRefsNamingStrategy;
208 }
209
210 public Boolean getIsDraft() {
211 return isDraft;
212 }
213
214 public void setIsDraft(Boolean isDraft) {
215 this.isDraft = isDraft;
216 }
217
218 public List<ExistingReference> getExistingReferences() {
219 return existingReferences;
220 }
221
222 public void setExistingReferences(List<ExistingReference> existingReferences) {
223 this.existingReferences = existingReferences;
224 }
225 }