1
1
package com .bunq .sdk .model .generated .endpoint ;
2
2
3
+ import com .bunq .sdk .context .ApiContext ;
4
+ import com .bunq .sdk .http .ApiClient ;
5
+ import com .bunq .sdk .http .BunqResponse ;
6
+ import com .bunq .sdk .http .BunqResponseRaw ;
3
7
import com .bunq .sdk .model .core .BunqModel ;
4
8
import com .bunq .sdk .model .core .MonetaryAccountReference ;
5
9
import com .bunq .sdk .model .generated .object .AvatarObject ;
11
15
import java .util .HashMap ;
12
16
import java .util .List ;
13
17
import java .util .Map ;
18
+ import javax .lang .model .type .NullType ;
14
19
15
20
/**
16
- * view for creating the feature announcement .
21
+ * view for updating the feature display .
17
22
*/
18
23
public class FeatureAnnouncementApiObject extends BunqModel {
19
24
20
25
/**
21
- * Field constants.
26
+ * Endpoint constants.
22
27
*/
23
- public static final String FIELD_AVATAR_UUID = "avatar_uuid " ;
24
- public static final String FIELD_TITLE = "title" ;
25
- public static final String FIELD_SUB_TITLE = "sub_title" ;
26
- public static final String FIELD_STATUS = "status" ;
27
- public static final String FIELD_FEATURE_ACCESS_ID = "feature_access_id" ;
28
- public static final String FIELD_CONTENT_TYPE = "content_type " ;
28
+ protected static final String ENDPOINT_URL_READ = "user/%s/feature-announcement/%s " ;
29
+
30
+ /**
31
+ * Object type.
32
+ */
33
+ protected static final String OBJECT_TYPE_GET = "FeatureAnnouncement " ;
29
34
30
35
/**
31
36
* The Avatar of the event overview.
@@ -35,113 +40,45 @@ public class FeatureAnnouncementApiObject extends BunqModel {
35
40
private AvatarObject avatar ;
36
41
37
42
/**
38
- * The event title of the feature announcement.
43
+ * The event overview title of the feature display
39
44
*/
40
45
@ Expose
41
46
@ SerializedName ("title" )
42
- private List < String > title ;
47
+ private String title ;
43
48
44
49
/**
45
- * The event sub title of the feature announcement.
50
+ * The event overview subtitle of the feature display
46
51
*/
47
52
@ Expose
48
53
@ SerializedName ("sub_title" )
49
- private List < String > subTitle ;
54
+ private String subTitle ;
50
55
51
56
/**
52
- * The type of the feature announcement.
57
+ * The type of the feature announcement so apps can override with their own stuff if desired
53
58
*/
54
59
@ Expose
55
60
@ SerializedName ("type" )
56
61
private String type ;
57
62
58
63
/**
59
- * The status of the feature announcement.
60
- */
61
- @ Expose
62
- @ SerializedName ("status" )
63
- private String status ;
64
-
65
- /**
66
- * The event sub title of the feature announcement.
67
- */
68
- @ Expose
69
- @ SerializedName ("all_feature_announcement_content" )
70
- private List <String > allFeatureAnnouncementContent ;
71
-
72
- /**
73
- * The avatar uuid.
74
- */
75
- @ Expose
76
- @ SerializedName ("avatar_uuid_field_for_request" )
77
- private String avatarUuidFieldForRequest ;
78
-
79
- /**
80
- * The event title of the feature announcement.
81
- */
82
- @ Expose
83
- @ SerializedName ("title_field_for_request" )
84
- private List <String > titleFieldForRequest ;
85
-
86
- /**
87
- * The event sub title of the feature announcement.
88
- */
89
- @ Expose
90
- @ SerializedName ("sub_title_field_for_request" )
91
- private List <String > subTitleFieldForRequest ;
92
-
93
- /**
94
- * The status of the feature announcement.
95
- */
96
- @ Expose
97
- @ SerializedName ("status_field_for_request" )
98
- private String statusFieldForRequest ;
99
-
100
- /**
101
- * The feature access id that controls the feature announcement.
102
- */
103
- @ Expose
104
- @ SerializedName ("feature_access_id_field_for_request" )
105
- private String featureAccessIdFieldForRequest ;
106
-
107
- /**
108
- * The content type of the feature announcement.
109
64
*/
110
- @ Expose
111
- @ SerializedName ("content_type_field_for_request" )
112
- private String contentTypeFieldForRequest ;
113
-
114
- public FeatureAnnouncementApiObject () {
115
- this (null , null , null , null , null , null );
116
- }
117
-
118
- public FeatureAnnouncementApiObject (List <String > title ) {
119
- this (title , null , null , null , null , null );
120
- }
121
-
122
- public FeatureAnnouncementApiObject (List <String > title , List <String > subTitle ) {
123
- this (title , subTitle , null , null , null , null );
124
- }
65
+ public static BunqResponse <FeatureAnnouncementApiObject > get (Long featureAnnouncementId , Map <String , String > params , Map <String , String > customHeaders ) {
66
+ ApiClient apiClient = new ApiClient (getApiContext ());
67
+ BunqResponseRaw responseRaw = apiClient .get (String .format (ENDPOINT_URL_READ , determineUserId (), featureAnnouncementId ), params , customHeaders );
125
68
126
- public FeatureAnnouncementApiObject (List <String > title , List <String > subTitle , String contentType ) {
127
- this (title , subTitle , contentType , null , null , null );
69
+ return fromJson (FeatureAnnouncementApiObject .class , responseRaw , OBJECT_TYPE_GET );
128
70
}
129
71
130
- public FeatureAnnouncementApiObject ( List < String > title , List < String > subTitle , String contentType , String avatarUuid ) {
131
- this ( title , subTitle , contentType , avatarUuid , null , null );
72
+ public static BunqResponse < FeatureAnnouncementApiObject > get ( ) {
73
+ return get ( null , null , null );
132
74
}
133
75
134
- public FeatureAnnouncementApiObject ( List < String > title , List < String > subTitle , String contentType , String avatarUuid , String status ) {
135
- this ( title , subTitle , contentType , avatarUuid , status , null );
76
+ public static BunqResponse < FeatureAnnouncementApiObject > get ( Long featureAnnouncementId ) {
77
+ return get ( featureAnnouncementId , null , null );
136
78
}
137
79
138
- public FeatureAnnouncementApiObject (List <String > title , List <String > subTitle , String contentType , String avatarUuid , String status , String featureAccessId ) {
139
- this .avatarUuidFieldForRequest = avatarUuid ;
140
- this .titleFieldForRequest = title ;
141
- this .subTitleFieldForRequest = subTitle ;
142
- this .statusFieldForRequest = status ;
143
- this .featureAccessIdFieldForRequest = featureAccessId ;
144
- this .contentTypeFieldForRequest = contentType ;
80
+ public static BunqResponse <FeatureAnnouncementApiObject > get (Long featureAnnouncementId , Map <String , String > params ) {
81
+ return get (featureAnnouncementId , params , null );
145
82
}
146
83
147
84
/**
@@ -156,29 +93,29 @@ public void setAvatar(AvatarObject avatar) {
156
93
}
157
94
158
95
/**
159
- * The event title of the feature announcement.
96
+ * The event overview title of the feature display
160
97
*/
161
- public List < String > getTitle () {
98
+ public String getTitle () {
162
99
return this .title ;
163
100
}
164
101
165
- public void setTitle (List < String > title ) {
102
+ public void setTitle (String title ) {
166
103
this .title = title ;
167
104
}
168
105
169
106
/**
170
- * The event sub title of the feature announcement.
107
+ * The event overview subtitle of the feature display
171
108
*/
172
- public List < String > getSubTitle () {
109
+ public String getSubTitle () {
173
110
return this .subTitle ;
174
111
}
175
112
176
- public void setSubTitle (List < String > subTitle ) {
113
+ public void setSubTitle (String subTitle ) {
177
114
this .subTitle = subTitle ;
178
115
}
179
116
180
117
/**
181
- * The type of the feature announcement.
118
+ * The type of the feature announcement so apps can override with their own stuff if desired
182
119
*/
183
120
public String getType () {
184
121
return this .type ;
@@ -188,28 +125,6 @@ public void setType(String type) {
188
125
this .type = type ;
189
126
}
190
127
191
- /**
192
- * The status of the feature announcement.
193
- */
194
- public String getStatus () {
195
- return this .status ;
196
- }
197
-
198
- public void setStatus (String status ) {
199
- this .status = status ;
200
- }
201
-
202
- /**
203
- * The event sub title of the feature announcement.
204
- */
205
- public List <String > getAllFeatureAnnouncementContent () {
206
- return this .allFeatureAnnouncementContent ;
207
- }
208
-
209
- public void setAllFeatureAnnouncementContent (List <String > allFeatureAnnouncementContent ) {
210
- this .allFeatureAnnouncementContent = allFeatureAnnouncementContent ;
211
- }
212
-
213
128
/**
214
129
*/
215
130
public boolean isAllFieldNull () {
@@ -229,14 +144,6 @@ public boolean isAllFieldNull() {
229
144
return false ;
230
145
}
231
146
232
- if (this .status != null ) {
233
- return false ;
234
- }
235
-
236
- if (this .allFeatureAnnouncementContent != null ) {
237
- return false ;
238
- }
239
-
240
147
return true ;
241
148
}
242
149
0 commit comments