1616
1717package com .linecorp .bot .model .message .flex .component ;
1818
19+ import java .util .ArrayList ;
20+ import java .util .Arrays ;
1921import java .util .Collections ;
2022import java .util .List ;
2123
2628import com .fasterxml .jackson .annotation .JsonTypeName ;
2729
2830import com .linecorp .bot .model .action .Action ;
31+ import com .linecorp .bot .model .message .flex .unit .FlexBorderWidthSize ;
32+ import com .linecorp .bot .model .message .flex .unit .FlexCornerRadiusSize ;
2933import com .linecorp .bot .model .message .flex .unit .FlexLayout ;
3034import com .linecorp .bot .model .message .flex .unit .FlexMarginSize ;
35+ import com .linecorp .bot .model .message .flex .unit .FlexOffsetSize ;
36+ import com .linecorp .bot .model .message .flex .unit .FlexPaddingSize ;
37+ import com .linecorp .bot .model .message .flex .unit .FlexPosition ;
3138
3239import lombok .Builder ;
3340import lombok .Value ;
@@ -48,6 +55,38 @@ public class Box implements FlexComponent {
4855
4956 private final FlexMarginSize margin ;
5057
58+ private final FlexPosition position ;
59+
60+ private final String offsetTop ;
61+
62+ private final String offsetBottom ;
63+
64+ private final String offsetStart ;
65+
66+ private final String offsetEnd ;
67+
68+ private final String backgroundColor ;
69+
70+ private final String borderColor ;
71+
72+ private final String borderWidth ;
73+
74+ private final String cornerRadius ;
75+
76+ private final String width ;
77+
78+ private final String height ;
79+
80+ private final String paddingAll ;
81+
82+ private final String paddingTop ;
83+
84+ private final String paddingBottom ;
85+
86+ private final String paddingStart ;
87+
88+ private final String paddingEnd ;
89+
5190 private final Action action ;
5291
5392 @ JsonCreator
@@ -57,12 +96,171 @@ public Box(
5796 @ JsonProperty ("contents" ) List <FlexComponent > contents ,
5897 @ JsonProperty ("spacing" ) FlexMarginSize spacing ,
5998 @ JsonProperty ("margin" ) FlexMarginSize margin ,
99+ @ JsonProperty ("position" ) FlexPosition position ,
100+ @ JsonProperty ("offsetTop" ) String offsetTop ,
101+ @ JsonProperty ("offsetBottom" ) String offsetBottom ,
102+ @ JsonProperty ("offsetStart" ) String offsetStart ,
103+ @ JsonProperty ("offsetEnd" ) String offsetEnd ,
104+ @ JsonProperty ("backgroundColor" ) String backgroundColor ,
105+ @ JsonProperty ("borderColor" ) String borderColor ,
106+ @ JsonProperty ("borderWidth" ) String borderWidth ,
107+ @ JsonProperty ("cornerRadius" ) String cornerRadius ,
108+ @ JsonProperty ("width" ) String width ,
109+ @ JsonProperty ("height" ) String height ,
110+ @ JsonProperty ("paddingAll" ) String paddingAll ,
111+ @ JsonProperty ("paddingTop" ) String paddingTop ,
112+ @ JsonProperty ("paddingBottom" ) String paddingBottom ,
113+ @ JsonProperty ("paddingStart" ) String paddingStart ,
114+ @ JsonProperty ("paddingEnd" ) String paddingEnd ,
60115 @ JsonProperty ("action" ) Action action ) {
61116 this .layout = layout ;
62117 this .flex = flex ;
63118 this .contents = contents != null ? contents : Collections .emptyList ();
64119 this .spacing = spacing ;
65120 this .margin = margin ;
121+ this .position = position ;
122+ this .offsetTop = offsetTop ;
123+ this .offsetBottom = offsetBottom ;
124+ this .offsetStart = offsetStart ;
125+ this .offsetEnd = offsetEnd ;
126+ this .backgroundColor = backgroundColor ;
127+ this .borderColor = borderColor ;
128+ this .borderWidth = borderWidth ;
129+ this .cornerRadius = cornerRadius ;
130+ this .width = width ;
131+ this .height = height ;
132+ this .paddingAll = paddingAll ;
133+ this .paddingTop = paddingTop ;
134+ this .paddingBottom = paddingBottom ;
135+ this .paddingStart = paddingStart ;
136+ this .paddingEnd = paddingEnd ;
66137 this .action = action ;
67138 }
139+
140+ public static class BoxBuilder {
141+
142+ public BoxBuilder contents (List <FlexComponent > contents ) {
143+ this .contents = new ArrayList <>(contents );
144+ return this ;
145+ }
146+
147+ public BoxBuilder contents (FlexComponent ... contents ) {
148+ this .contents = Arrays .asList (contents );
149+ return this ;
150+ }
151+
152+ public BoxBuilder content (FlexComponent content ) {
153+ return contents (content );
154+ }
155+
156+ public BoxBuilder paddingAll (FlexPaddingSize padding ) {
157+ paddingAll = padding .getPropertyValue ();
158+ return this ;
159+ }
160+
161+ public BoxBuilder paddingAll (String padding ) {
162+ paddingAll = padding ;
163+ return this ;
164+ }
165+
166+ public BoxBuilder paddingTop (FlexPaddingSize padding ) {
167+ paddingTop = padding .getPropertyValue ();
168+ return this ;
169+ }
170+
171+ public BoxBuilder paddingTop (String padding ) {
172+ paddingTop = padding ;
173+ return this ;
174+ }
175+
176+ public BoxBuilder paddingBottom (FlexPaddingSize padding ) {
177+ paddingBottom = padding .getPropertyValue ();
178+ return this ;
179+ }
180+
181+ public BoxBuilder paddingBottom (String padding ) {
182+ paddingBottom = padding ;
183+ return this ;
184+ }
185+
186+ public BoxBuilder paddingStart (FlexPaddingSize padding ) {
187+ paddingStart = padding .getPropertyValue ();
188+ return this ;
189+ }
190+
191+ public BoxBuilder paddingStart (String padding ) {
192+ paddingStart = padding ;
193+ return this ;
194+ }
195+
196+ public BoxBuilder paddingEnd (FlexPaddingSize padding ) {
197+ paddingEnd = padding .getPropertyValue ();
198+ return this ;
199+ }
200+
201+ public BoxBuilder paddingEnd (String padding ) {
202+ paddingEnd = padding ;
203+ return this ;
204+ }
205+
206+ public BoxBuilder offsetTop (FlexOffsetSize padding ) {
207+ offsetTop = padding .getPropertyValue ();
208+ return this ;
209+ }
210+
211+ public BoxBuilder offsetTop (String offset ) {
212+ offsetTop = offset ;
213+ return this ;
214+ }
215+
216+ public BoxBuilder offsetBottom (FlexOffsetSize offset ) {
217+ offsetBottom = offset .getPropertyValue ();
218+ return this ;
219+ }
220+
221+ public BoxBuilder offsetBottom (String offset ) {
222+ offsetBottom = offset ;
223+ return this ;
224+ }
225+
226+ public BoxBuilder offsetStart (FlexOffsetSize offset ) {
227+ offsetStart = offset .getPropertyValue ();
228+ return this ;
229+ }
230+
231+ public BoxBuilder offsetStart (String offset ) {
232+ offsetStart = offset ;
233+ return this ;
234+ }
235+
236+ public BoxBuilder offsetEnd (FlexOffsetSize offset ) {
237+ offsetEnd = offset .getPropertyValue ();
238+ return this ;
239+ }
240+
241+ public BoxBuilder offsetEnd (String offset ) {
242+ offsetEnd = offset ;
243+ return this ;
244+ }
245+
246+ public BoxBuilder borderWidth (FlexBorderWidthSize width ) {
247+ borderWidth = width .getPropertyValue ();
248+ return this ;
249+ }
250+
251+ public BoxBuilder borderWidth (String width ) {
252+ borderWidth = width ;
253+ return this ;
254+ }
255+
256+ public BoxBuilder cornerRadius (FlexCornerRadiusSize radius ) {
257+ cornerRadius = radius .getPropertyValue ();
258+ return this ;
259+ }
260+
261+ public BoxBuilder cornerRadius (String radius ) {
262+ cornerRadius = radius ;
263+ return this ;
264+ }
265+ }
68266}
0 commit comments