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