Skip to content

Commit

Permalink
Retire GET /v2/bot/message/delivery/ad_phone (#535)
Browse files Browse the repository at this point in the history
line/line-openapi#82

`GET /v2/bot/message/delivery/ad_phone` was sunset.
This change removes it as it's no longer necessary to include it in
line-openapi.

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
github-actions[bot] and github-actions authored Jan 21, 2025
1 parent c912145 commit 9dd9c78
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
2 changes: 1 addition & 1 deletion line-openapi
Submodule line-openapi updated 1 files
+0 −37 messaging-api.yml
71 changes: 0 additions & 71 deletions linebot/messaging_api/api_messaging_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9dd9c78

Please sign in to comment.