Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retire GET /v2/bot/message/delivery/ad_phone #535

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading