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