
1package main
2
3import (
4 "demo/wxpay_brand_utility"
5 "encoding/json"
6 "fmt"
7 "net/http"
8 "net/url"
9 "strings"
10 "time"
11)
12
13func main() {
14
15 config, err := wxpay_brand_utility.CreateBrandConfig(
16 "xxxxxxxx",
17 "1DDE55AD98Exxxxxxxxxx",
18 "/path/to/apiclient_key.pem",
19 "PUB_KEY_ID_xxxxxxxxxxxxx",
20 "/path/to/wxp_pub.pem",
21 )
22 if err != nil {
23 fmt.Println(err)
24 return
25 }
26
27 request := &GetUserProductCouponRequest{
28 ProductCouponId: wxpay_brand_utility.String("1000000013"),
29 StockId: wxpay_brand_utility.String("1000000013001"),
30 CouponCode: wxpay_brand_utility.String("Code_123456"),
31 Appid: wxpay_brand_utility.String("wx233544546545989"),
32 Openid: wxpay_brand_utility.String("oh-394z-6CGkNoJrsDLTTUKiAnp4"),
33 }
34
35 response, err := GetUserProductCoupon(config, request)
36 if err != nil {
37 fmt.Printf("请求失败: %+v\n", err)
38
39 return
40 }
41
42
43 fmt.Printf("请求成功: %+v\n", response)
44}
45
46func GetUserProductCoupon(config *wxpay_brand_utility.BrandConfig, request *GetUserProductCouponRequest) (response *UserProductCouponEntity, err error) {
47 const (
48 host = "https://api.mch.weixin.qq.com"
49 method = "GET"
50 path = "/brand/marketing/product-coupon/users/{openid}/coupons/{coupon_code}"
51 )
52
53 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path))
54 if err != nil {
55 return nil, err
56 }
57 reqUrl.Path = strings.Replace(reqUrl.Path, "{coupon_code}", url.PathEscape(*request.CouponCode), -1)
58 reqUrl.Path = strings.Replace(reqUrl.Path, "{openid}", url.PathEscape(*request.Openid), -1)
59 query := reqUrl.Query()
60 if request.ProductCouponId != nil {
61 query.Add("product_coupon_id", *request.ProductCouponId)
62 }
63 if request.StockId != nil {
64 query.Add("stock_id", *request.StockId)
65 }
66 if request.Appid != nil {
67 query.Add("appid", *request.Appid)
68 }
69 reqUrl.RawQuery = query.Encode()
70 httpRequest, err := http.NewRequest(method, reqUrl.String(), nil)
71 if err != nil {
72 return nil, err
73 }
74 httpRequest.Header.Set("Accept", "application/json")
75 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId())
76 authorization, err := wxpay_brand_utility.BuildAuthorization(config.BrandId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), nil)
77 if err != nil {
78 return nil, err
79 }
80 httpRequest.Header.Set("Authorization", authorization)
81
82 client := &http.Client{}
83 httpResponse, err := client.Do(httpRequest)
84 if err != nil {
85 return nil, err
86 }
87 respBody, err := wxpay_brand_utility.ExtractResponseBody(httpResponse)
88 if err != nil {
89 return nil, err
90 }
91 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 {
92
93 err = wxpay_brand_utility.ValidateResponse(
94 config.WechatPayPublicKeyId(),
95 config.WechatPayPublicKey(),
96 &httpResponse.Header,
97 respBody,
98 )
99 if err != nil {
100 return nil, err
101 }
102 response := &UserProductCouponEntity{}
103 if err := json.Unmarshal(respBody, response); err != nil {
104 return nil, err
105 }
106
107 return response, nil
108 } else {
109 return nil, wxpay_brand_utility.NewApiException(
110 httpResponse.StatusCode,
111 httpResponse.Header,
112 respBody,
113 )
114 }
115}
116
117type GetUserProductCouponRequest struct {
118 ProductCouponId *string `json:"product_coupon_id,omitempty"`
119 StockId *string `json:"stock_id,omitempty"`
120 CouponCode *string `json:"coupon_code,omitempty"`
121 Appid *string `json:"appid,omitempty"`
122 Openid *string `json:"openid,omitempty"`
123}
124
125func (o *GetUserProductCouponRequest) MarshalJSON() ([]byte, error) {
126 type Alias GetUserProductCouponRequest
127 a := &struct {
128 ProductCouponId *string `json:"product_coupon_id,omitempty"`
129 StockId *string `json:"stock_id,omitempty"`
130 CouponCode *string `json:"coupon_code,omitempty"`
131 Appid *string `json:"appid,omitempty"`
132 Openid *string `json:"openid,omitempty"`
133 *Alias
134 }{
135
136 ProductCouponId: nil,
137 StockId: nil,
138 CouponCode: nil,
139 Appid: nil,
140 Openid: nil,
141 Alias: (*Alias)(o),
142 }
143 return json.Marshal(a)
144}
145
146type UserProductCouponEntity struct {
147 CouponCode *string `json:"coupon_code,omitempty"`
148 CouponState *UserProductCouponState `json:"coupon_state,omitempty"`
149 ValidBeginTime *time.Time `json:"valid_begin_time,omitempty"`
150 ValidEndTime *time.Time `json:"valid_end_time,omitempty"`
151 ReceiveTime *string `json:"receive_time,omitempty"`
152 SendRequestNo *string `json:"send_request_no,omitempty"`
153 SendChannel *UserProductCouponSendChannel `json:"send_channel,omitempty"`
154 ConfirmRequestNo *string `json:"confirm_request_no,omitempty"`
155 ConfirmTime *time.Time `json:"confirm_time,omitempty"`
156 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
157 DeactivateTime *string `json:"deactivate_time,omitempty"`
158 DeactivateReason *string `json:"deactivate_reason,omitempty"`
159 SingleUsageDetail *CouponUsageDetail `json:"single_usage_detail,omitempty"`
160 ProgressiveBundleUsageDetail *CouponUsageDetail `json:"progressive_bundle_usage_detail,omitempty"`
161 UserProductCouponBundleInfo *UserProductCouponBundleInfo `json:"user_product_coupon_bundle_info,omitempty"`
162 ProductCoupon *ProductCouponEntity `json:"product_coupon,omitempty"`
163 Stock *StockEntity `json:"stock,omitempty"`
164 Attach *string `json:"attach,omitempty"`
165 ChannelCustomInfo *string `json:"channel_custom_info,omitempty"`
166 CouponTagInfo *CouponTagInfo `json:"coupon_tag_info,omitempty"`
167}
168
169type UserProductCouponState string
170
171func (e UserProductCouponState) Ptr() *UserProductCouponState {
172 return &e
173}
174
175const (
176 USERPRODUCTCOUPONSTATE_CONFIRMING UserProductCouponState = "CONFIRMING"
177 USERPRODUCTCOUPONSTATE_PENDING UserProductCouponState = "PENDING"
178 USERPRODUCTCOUPONSTATE_EFFECTIVE UserProductCouponState = "EFFECTIVE"
179 USERPRODUCTCOUPONSTATE_USED UserProductCouponState = "USED"
180 USERPRODUCTCOUPONSTATE_EXPIRED UserProductCouponState = "EXPIRED"
181 USERPRODUCTCOUPONSTATE_DELETED UserProductCouponState = "DELETED"
182 USERPRODUCTCOUPONSTATE_DEACTIVATED UserProductCouponState = "DEACTIVATED"
183)
184
185type UserProductCouponSendChannel string
186
187func (e UserProductCouponSendChannel) Ptr() *UserProductCouponSendChannel {
188 return &e
189}
190
191const (
192 USERPRODUCTCOUPONSENDCHANNEL_BRAND_MANAGE UserProductCouponSendChannel = "BRAND_MANAGE"
193 USERPRODUCTCOUPONSENDCHANNEL_API UserProductCouponSendChannel = "API"
194 USERPRODUCTCOUPONSENDCHANNEL_RECEIVE_COMPONENT UserProductCouponSendChannel = "RECEIVE_COMPONENT"
195 USERPRODUCTCOUPONSENDCHANNEL_MEMBER UserProductCouponSendChannel = "MEMBER"
196 USERPRODUCTCOUPONSENDCHANNEL_STICKER_GIFT UserProductCouponSendChannel = "STICKER_GIFT"
197)
198
199type CouponUsageDetail struct {
200 UseRequestNo *string `json:"use_request_no,omitempty"`
201 UseTime *time.Time `json:"use_time,omitempty"`
202 ReturnRequestNo *string `json:"return_request_no,omitempty"`
203 ReturnTime *time.Time `json:"return_time,omitempty"`
204 AssociatedOrderInfo *UserProductCouponAssociatedOrderInfo `json:"associated_order_info,omitempty"`
205 AssociatedPayScoreOrderInfo *UserProductCouponAssociatedPayScoreOrderInfo `json:"associated_pay_score_order_info,omitempty"`
206 SavedAmount *int64 `json:"saved_amount,omitempty"`
207 UseProductNoList []string `json:"use_product_no_list,omitempty"`
208}
209
210type UserProductCouponBundleInfo struct {
211 UserCouponBundleId *string `json:"user_coupon_bundle_id,omitempty"`
212 UserCouponBundleIndex *int64 `json:"user_coupon_bundle_index,omitempty"`
213 TotalCount *int64 `json:"total_count,omitempty"`
214 UsedCount *int64 `json:"used_count,omitempty"`
215}
216
217type ProductCouponEntity struct {
218 ProductCouponId *string `json:"product_coupon_id,omitempty"`
219 Scope *ProductCouponScope `json:"scope,omitempty"`
220 Type *ProductCouponType `json:"type,omitempty"`
221 UsageMode *UsageMode `json:"usage_mode,omitempty"`
222 SingleUsageInfo *SingleUsageInfo `json:"single_usage_info,omitempty"`
223 ProgressiveBundleUsageInfo *ProgressiveBundleUsageInfo `json:"progressive_bundle_usage_info,omitempty"`
224 DisplayInfo *ProductCouponDisplayInfo `json:"display_info,omitempty"`
225 OutProductNo *string `json:"out_product_no,omitempty"`
226 State *ProductCouponState `json:"state,omitempty"`
227 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
228 DeactivateTime *string `json:"deactivate_time,omitempty"`
229 DeactivateReason *string `json:"deactivate_reason,omitempty"`
230 ShowAsExchange *bool `json:"show_as_exchange,omitempty"`
231 AvailableProductNoList []string `json:"available_product_no_list,omitempty"`
232}
233
234type StockEntity struct {
235 ProductCouponId *string `json:"product_coupon_id,omitempty"`
236 StockId *string `json:"stock_id,omitempty"`
237 Remark *string `json:"remark,omitempty"`
238 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
239 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"`
240 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
241 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"`
242 ProgressiveBundleUsageRule *StockUsageRule `json:"progressive_bundle_usage_rule,omitempty"`
243 StockBundleInfo *StockBundleInfo `json:"stock_bundle_info,omitempty"`
244 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
245 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
246 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
247 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
248 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"`
249 State *StockState `json:"state,omitempty"`
250 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
251 DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
252 DeactivateReason *string `json:"deactivate_reason,omitempty"`
253}
254
255type CouponTagInfo struct {
256 CouponTagList []UserProductCouponTag `json:"coupon_tag_list,omitempty"`
257 MemberTagInfo *MemberTagInfo `json:"member_tag_info,omitempty"`
258}
259
260type UserProductCouponAssociatedOrderInfo struct {
261 TransactionId *string `json:"transaction_id,omitempty"`
262 OutTradeNo *string `json:"out_trade_no,omitempty"`
263 Mchid *string `json:"mchid,omitempty"`
264 SubMchid *string `json:"sub_mchid,omitempty"`
265}
266
267type UserProductCouponAssociatedPayScoreOrderInfo struct {
268 OrderId *string `json:"order_id,omitempty"`
269 OutOrderNo *string `json:"out_order_no,omitempty"`
270 Mchid *string `json:"mchid,omitempty"`
271 SubMchid *string `json:"sub_mchid,omitempty"`
272}
273
274type ProductCouponScope string
275
276func (e ProductCouponScope) Ptr() *ProductCouponScope {
277 return &e
278}
279
280const (
281 PRODUCTCOUPONSCOPE_ALL ProductCouponScope = "ALL"
282 PRODUCTCOUPONSCOPE_SINGLE ProductCouponScope = "SINGLE"
283 PRODUCTCOUPONSCOPE_CATEGORY ProductCouponScope = "CATEGORY"
284)
285
286type ProductCouponType string
287
288func (e ProductCouponType) Ptr() *ProductCouponType {
289 return &e
290}
291
292const (
293 PRODUCTCOUPONTYPE_NORMAL ProductCouponType = "NORMAL"
294 PRODUCTCOUPONTYPE_DISCOUNT ProductCouponType = "DISCOUNT"
295 PRODUCTCOUPONTYPE_EXCHANGE ProductCouponType = "EXCHANGE"
296)
297
298type UsageMode string
299
300func (e UsageMode) Ptr() *UsageMode {
301 return &e
302}
303
304const (
305 USAGEMODE_SINGLE UsageMode = "SINGLE"
306 USAGEMODE_PROGRESSIVE_BUNDLE UsageMode = "PROGRESSIVE_BUNDLE"
307)
308
309type SingleUsageInfo struct {
310 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
311 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
312}
313
314type ProgressiveBundleUsageInfo struct {
315 Count *int64 `json:"count,omitempty"`
316 IntervalDays *int64 `json:"interval_days,omitempty"`
317}
318
319type ProductCouponDisplayInfo struct {
320 Name *string `json:"name,omitempty"`
321 ImageUrl *string `json:"image_url,omitempty"`
322 BackgroundUrl *string `json:"background_url,omitempty"`
323 DetailImageUrlList []string `json:"detail_image_url_list,omitempty"`
324 OriginalPrice *int64 `json:"original_price,omitempty"`
325 ComboPackageList []ComboPackage `json:"combo_package_list,omitempty"`
326}
327
328type ProductCouponState string
329
330func (e ProductCouponState) Ptr() *ProductCouponState {
331 return &e
332}
333
334const (
335 PRODUCTCOUPONSTATE_AUDITING ProductCouponState = "AUDITING"
336 PRODUCTCOUPONSTATE_EFFECTIVE ProductCouponState = "EFFECTIVE"
337 PRODUCTCOUPONSTATE_DEACTIVATED ProductCouponState = "DEACTIVATED"
338)
339
340type CouponCodeMode string
341
342func (e CouponCodeMode) Ptr() *CouponCodeMode {
343 return &e
344}
345
346const (
347 COUPONCODEMODE_WECHATPAY CouponCodeMode = "WECHATPAY"
348 COUPONCODEMODE_UPLOAD CouponCodeMode = "UPLOAD"
349 COUPONCODEMODE_API_ASSIGN CouponCodeMode = "API_ASSIGN"
350)
351
352type CouponCodeCountInfo struct {
353 TotalCount *int64 `json:"total_count,omitempty"`
354 AvailableCount *int64 `json:"available_count,omitempty"`
355}
356
357type StockSendRule struct {
358 MaxCount *int64 `json:"max_count,omitempty"`
359 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"`
360 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"`
361}
362
363type SingleUsageRule struct {
364 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
365 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
366 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
367 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
368}
369
370type StockUsageRule struct {
371 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
372 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
373 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
374 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
375}
376
377type StockBundleInfo struct {
378 StockBundleId *string `json:"stock_bundle_id,omitempty"`
379 StockBundleIndex *int64 `json:"stock_bundle_index,omitempty"`
380}
381
382type UsageRuleDisplayInfo struct {
383 CouponUsageMethodList []CouponUsageMethod `json:"coupon_usage_method_list,omitempty"`
384 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
385 MiniProgramPath *string `json:"mini_program_path,omitempty"`
386 AppPath *string `json:"app_path,omitempty"`
387 UsageDescription *string `json:"usage_description,omitempty"`
388 CouponAvailableStoreInfo *CouponAvailableStoreInfo `json:"coupon_available_store_info,omitempty"`
389 AppJumpType *AppJumpType `json:"app_jump_type,omitempty"`
390 PasscodeLink *string `json:"passcode_link,omitempty"`
391}
392
393type CouponDisplayInfo struct {
394 CodeDisplayMode *CouponCodeDisplayMode `json:"code_display_mode,omitempty"`
395 BackgroundColor *string `json:"background_color,omitempty"`
396 EntranceMiniProgram *EntranceMiniProgram `json:"entrance_mini_program,omitempty"`
397 EntranceOfficialAccount *EntranceOfficialAccount `json:"entrance_official_account,omitempty"`
398}
399
400type NotifyConfig struct {
401 NotifyAppid *string `json:"notify_appid,omitempty"`
402}
403
404type StockStoreScope string
405
406func (e StockStoreScope) Ptr() *StockStoreScope {
407 return &e
408}
409
410const (
411 STOCKSTORESCOPE_NONE StockStoreScope = "NONE"
412 STOCKSTORESCOPE_ALL StockStoreScope = "ALL"
413 STOCKSTORESCOPE_SPECIFIC StockStoreScope = "SPECIFIC"
414)
415
416type StockSentCountInfo struct {
417 TotalCount *int64 `json:"total_count,omitempty"`
418 TodayCount *int64 `json:"today_count,omitempty"`
419}
420
421type StockState string
422
423func (e StockState) Ptr() *StockState {
424 return &e
425}
426
427const (
428 STOCKSTATE_AUDITING StockState = "AUDITING"
429 STOCKSTATE_SENDING StockState = "SENDING"
430 STOCKSTATE_PAUSED StockState = "PAUSED"
431 STOCKSTATE_STOPPED StockState = "STOPPED"
432 STOCKSTATE_DEACTIVATED StockState = "DEACTIVATED"
433)
434
435type UserProductCouponTag string
436
437func (e UserProductCouponTag) Ptr() *UserProductCouponTag {
438 return &e
439}
440
441const (
442 USERPRODUCTCOUPONTAG_MEMBER UserProductCouponTag = "MEMBER"
443 USERPRODUCTCOUPONTAG_MEMBER_ACTIVITY UserProductCouponTag = "MEMBER_ACTIVITY"
444)
445
446type MemberTagInfo struct {
447 MemberCardId *string `json:"member_card_id,omitempty"`
448}
449
450type NormalCouponUsageRule struct {
451 Threshold *int64 `json:"threshold,omitempty"`
452 DiscountAmount *int64 `json:"discount_amount,omitempty"`
453}
454
455type DiscountCouponUsageRule struct {
456 Threshold *int64 `json:"threshold,omitempty"`
457 PercentOff *int64 `json:"percent_off,omitempty"`
458}
459
460type ComboPackage struct {
461 Name *string `json:"name,omitempty"`
462 PickCount *int64 `json:"pick_count,omitempty"`
463 ChoiceList []ComboPackageChoice `json:"choice_list,omitempty"`
464}
465
466type CouponAvailablePeriod struct {
467 AvailableBeginTime *string `json:"available_begin_time,omitempty"`
468 AvailableEndTime *string `json:"available_end_time,omitempty"`
469 AvailableDays *int64 `json:"available_days,omitempty"`
470 WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"`
471 WeeklyAvailablePeriod *FixedWeekPeriod `json:"weekly_available_period,omitempty"`
472 IrregularAvailablePeriodList []TimePeriod `json:"irregular_available_period_list,omitempty"`
473 AvailableSeconds *int64 `json:"available_seconds,omitempty"`
474}
475
476type ExchangeCouponUsageRule struct {
477 Threshold *int64 `json:"threshold,omitempty"`
478 ExchangePrice *int64 `json:"exchange_price,omitempty"`
479}
480
481type CouponUsageMethod string
482
483func (e CouponUsageMethod) Ptr() *CouponUsageMethod {
484 return &e
485}
486
487const (
488 COUPONUSAGEMETHOD_OFFLINE CouponUsageMethod = "OFFLINE"
489 COUPONUSAGEMETHOD_MINI_PROGRAM CouponUsageMethod = "MINI_PROGRAM"
490 COUPONUSAGEMETHOD_APP CouponUsageMethod = "APP"
491 COUPONUSAGEMETHOD_PAYMENT_CODE CouponUsageMethod = "PAYMENT_CODE"
492)
493
494type CouponAvailableStoreInfo struct {
495 Description *string `json:"description,omitempty"`
496 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
497 MiniProgramPath *string `json:"mini_program_path,omitempty"`
498}
499
500type AppJumpType string
501
502func (e AppJumpType) Ptr() *AppJumpType {
503 return &e
504}
505
506const (
507 APPJUMPTYPE_H5 AppJumpType = "H5"
508 APPJUMPTYPE_PASSCODE_LINK AppJumpType = "PASSCODE_LINK"
509 APPJUMPTYPE_USAGE_GUIDE AppJumpType = "USAGE_GUIDE"
510)
511
512type CouponCodeDisplayMode string
513
514func (e CouponCodeDisplayMode) Ptr() *CouponCodeDisplayMode {
515 return &e
516}
517
518const (
519 COUPONCODEDISPLAYMODE_INVISIBLE CouponCodeDisplayMode = "INVISIBLE"
520 COUPONCODEDISPLAYMODE_BARCODE CouponCodeDisplayMode = "BARCODE"
521 COUPONCODEDISPLAYMODE_QRCODE CouponCodeDisplayMode = "QRCODE"
522)
523
524type EntranceMiniProgram struct {
525 Appid *string `json:"appid,omitempty"`
526 Path *string `json:"path,omitempty"`
527 EntranceWording *string `json:"entrance_wording,omitempty"`
528 GuidanceWording *string `json:"guidance_wording,omitempty"`
529}
530
531type EntranceOfficialAccount struct {
532 Appid *string `json:"appid,omitempty"`
533}
534
535type ComboPackageChoice struct {
536 Name *string `json:"name,omitempty"`
537 Price *int64 `json:"price,omitempty"`
538 Count *int64 `json:"count,omitempty"`
539 ImageUrl *string `json:"image_url,omitempty"`
540 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
541 MiniProgramPath *string `json:"mini_program_path,omitempty"`
542}
543
544type FixedWeekPeriod struct {
545 DayList []WeekEnum `json:"day_list,omitempty"`
546 DayPeriodList []PeriodOfTheDay `json:"day_period_list,omitempty"`
547}
548
549type TimePeriod struct {
550 BeginTime *string `json:"begin_time,omitempty"`
551 EndTime *string `json:"end_time,omitempty"`
552}
553
554type WeekEnum string
555
556func (e WeekEnum) Ptr() *WeekEnum {
557 return &e
558}
559
560const (
561 WEEKENUM_MONDAY WeekEnum = "MONDAY"
562 WEEKENUM_TUESDAY WeekEnum = "TUESDAY"
563 WEEKENUM_WEDNESDAY WeekEnum = "WEDNESDAY"
564 WEEKENUM_THURSDAY WeekEnum = "THURSDAY"
565 WEEKENUM_FRIDAY WeekEnum = "FRIDAY"
566 WEEKENUM_SATURDAY WeekEnum = "SATURDAY"
567 WEEKENUM_SUNDAY WeekEnum = "SUNDAY"
568)
569
570type PeriodOfTheDay struct {
571 BeginTime *int64 `json:"begin_time,omitempty"`
572 EndTime *int64 `json:"end_time,omitempty"`
573}
574