diff --git a/line-openapi b/line-openapi index 5ae51b6a..950521ed 160000 --- a/line-openapi +++ b/line-openapi @@ -1 +1 @@ -Subproject commit 5ae51b6a91aea5da364666cdc60d24919ad0b6ad +Subproject commit 950521edd0f5a4508277a3f7e73563bf040aac0f diff --git a/linebot/messaging_api/api_messaging_api.go b/linebot/messaging_api/api_messaging_api.go index 387fafc6..39e1f1f0 100644 --- a/linebot/messaging_api/api_messaging_api.go +++ b/linebot/messaging_api/api_messaging_api.go @@ -511,77 +511,6 @@ func (client *MessagingApiAPI) DeleteRichMenuAliasWithHttpInfo( } -// GetAdPhoneMessageStatistics -// -// Get result of message delivery using phone number -// Parameters: -// date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9 - -// https://developers.line.biz/en/reference/partner-docs/#get-phone-audience-match -func (client *MessagingApiAPI) GetAdPhoneMessageStatistics( - - date string, - -) (*NumberOfMessagesResponse, error) { - _, body, error := client.GetAdPhoneMessageStatisticsWithHttpInfo( - - date, - ) - return body, error -} - -// GetAdPhoneMessageStatistics -// If you want to take advantage of the HTTPResponse object for status codes and headers, use this signature. -// -// Get result of message delivery using phone number -// Parameters: -// date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9 - -// https://developers.line.biz/en/reference/partner-docs/#get-phone-audience-match -func (client *MessagingApiAPI) GetAdPhoneMessageStatisticsWithHttpInfo( - - date string, - -) (*http.Response, *NumberOfMessagesResponse, error) { - path := "/v2/bot/message/delivery/ad_phone" - - req, err := http.NewRequest(http.MethodGet, client.Url(path), nil) - if err != nil { - return nil, nil, err - } - - query := url.Values{} - query.Add("date", date) - - req.URL.RawQuery = query.Encode() - - res, err := client.Do(req) - - if err != nil { - return res, nil, err - } - - if res.StatusCode/100 != 2 { - bodyBytes, err := io.ReadAll(res.Body) - bodyReader := bytes.NewReader(bodyBytes) - if err != nil { - return res, nil, fmt.Errorf("failed to read response body: %w", err) - } - res.Body = io.NopCloser(bodyReader) - return res, nil, fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, string(bodyBytes)) - } - - defer res.Body.Close() - - decoder := json.NewDecoder(res.Body) - result := NumberOfMessagesResponse{} - if err := decoder.Decode(&result); err != nil { - return res, nil, fmt.Errorf("failed to decode JSON: %w", err) - } - return res, &result, nil - -} - // GetAggregationUnitNameList // // Get name list of units used this month