11package com .bunq .sdk .model .generated .endpoint ;
22
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 ;
37import com .bunq .sdk .model .core .BunqModel ;
48import com .bunq .sdk .model .core .MonetaryAccountReference ;
59import com .bunq .sdk .model .generated .object .AvatarObject ;
1115import java .util .HashMap ;
1216import java .util .List ;
1317import java .util .Map ;
18+ import javax .lang .model .type .NullType ;
1419
1520/**
16- * view for creating the feature announcement .
21+ * view for updating the feature display .
1722 */
1823public class FeatureAnnouncementApiObject extends BunqModel {
1924
2025 /**
21- * Field constants.
26+ * Endpoint constants.
2227 */
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 " ;
2934
3035 /**
3136 * The Avatar of the event overview.
@@ -35,113 +40,45 @@ public class FeatureAnnouncementApiObject extends BunqModel {
3540 private AvatarObject avatar ;
3641
3742 /**
38- * The event title of the feature announcement.
43+ * The event overview title of the feature display
3944 */
4045 @ Expose
4146 @ SerializedName ("title" )
42- private List < String > title ;
47+ private String title ;
4348
4449 /**
45- * The event sub title of the feature announcement.
50+ * The event overview subtitle of the feature display
4651 */
4752 @ Expose
4853 @ SerializedName ("sub_title" )
49- private List < String > subTitle ;
54+ private String subTitle ;
5055
5156 /**
52- * The type of the feature announcement.
57+ * The type of the feature announcement so apps can override with their own stuff if desired
5358 */
5459 @ Expose
5560 @ SerializedName ("type" )
5661 private String type ;
5762
5863 /**
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.
10964 */
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 );
12568
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 );
12870 }
12971
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 );
13274 }
13375
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 );
13678 }
13779
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 );
14582 }
14683
14784 /**
@@ -156,29 +93,29 @@ public void setAvatar(AvatarObject avatar) {
15693 }
15794
15895 /**
159- * The event title of the feature announcement.
96+ * The event overview title of the feature display
16097 */
161- public List < String > getTitle () {
98+ public String getTitle () {
16299 return this .title ;
163100 }
164101
165- public void setTitle (List < String > title ) {
102+ public void setTitle (String title ) {
166103 this .title = title ;
167104 }
168105
169106 /**
170- * The event sub title of the feature announcement.
107+ * The event overview subtitle of the feature display
171108 */
172- public List < String > getSubTitle () {
109+ public String getSubTitle () {
173110 return this .subTitle ;
174111 }
175112
176- public void setSubTitle (List < String > subTitle ) {
113+ public void setSubTitle (String subTitle ) {
177114 this .subTitle = subTitle ;
178115 }
179116
180117 /**
181- * The type of the feature announcement.
118+ * The type of the feature announcement so apps can override with their own stuff if desired
182119 */
183120 public String getType () {
184121 return this .type ;
@@ -188,28 +125,6 @@ public void setType(String type) {
188125 this .type = type ;
189126 }
190127
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-
213128 /**
214129 */
215130 public boolean isAllFieldNull () {
@@ -229,14 +144,6 @@ public boolean isAllFieldNull() {
229144 return false ;
230145 }
231146
232- if (this .status != null ) {
233- return false ;
234- }
235-
236- if (this .allFeatureAnnouncementContent != null ) {
237- return false ;
238- }
239-
240147 return true ;
241148 }
242149
0 commit comments