From a5e62df8f157aa39700add7a6896dc0b5d48162d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:42:41 +0900 Subject: [PATCH] Remove obsolete feature: Audience Match (#530) https://github.com/line/line-openapi/pull/80 The Audience Match feature (/bot/ad/multicast/phone) was sunset in October 2023. This change removes it as it's no longer necessary to include it in line-openapi. --------- Co-authored-by: github-actions Co-authored-by: Yuta Kasai --- .gitignore | 3 + .../messaging_api/.openapi-generator/FILES | 1 - linebot/messaging_api/api_messaging_api.go | 67 ------------------- 3 files changed, 3 insertions(+), 68 deletions(-) diff --git a/.gitignore b/.gitignore index 930d994a..2cbf6ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ _testmain.go .idea* /.vscode/ + +# github workflow +pr_info.json diff --git a/linebot/messaging_api/.openapi-generator/FILES b/linebot/messaging_api/.openapi-generator/FILES index c822ef1f..5574c12e 100644 --- a/linebot/messaging_api/.openapi-generator/FILES +++ b/linebot/messaging_api/.openapi-generator/FILES @@ -9,7 +9,6 @@ model_app_type_demographic.go model_app_type_demographic_filter.go model_area_demographic.go model_area_demographic_filter.go -model_audience_match_messages_request.go model_audience_recipient.go model_audio_message.go model_bot_info_response.go diff --git a/linebot/messaging_api/api_messaging_api.go b/linebot/messaging_api/api_messaging_api.go index 3a1ab5a0..387fafc6 100644 --- a/linebot/messaging_api/api_messaging_api.go +++ b/linebot/messaging_api/api_messaging_api.go @@ -116,73 +116,6 @@ func WithEndpoint(endpoint string) MessagingApiAPIOption { } } -// AudienceMatch -// -// Send a message using phone number -// Parameters: -// audienceMatchMessagesRequest - -// https://developers.line.biz/en/reference/partner-docs/#phone-audience-match -func (client *MessagingApiAPI) AudienceMatch( - - audienceMatchMessagesRequest *AudienceMatchMessagesRequest, - -) (struct{}, error) { - _, body, error := client.AudienceMatchWithHttpInfo( - - audienceMatchMessagesRequest, - ) - return body, error -} - -// AudienceMatch -// If you want to take advantage of the HTTPResponse object for status codes and headers, use this signature. -// -// Send a message using phone number -// Parameters: -// audienceMatchMessagesRequest - -// https://developers.line.biz/en/reference/partner-docs/#phone-audience-match -func (client *MessagingApiAPI) AudienceMatchWithHttpInfo( - - audienceMatchMessagesRequest *AudienceMatchMessagesRequest, - -) (*http.Response, struct{}, error) { - path := "/bot/ad/multicast/phone" - - var buf bytes.Buffer - enc := json.NewEncoder(&buf) - if err := enc.Encode(audienceMatchMessagesRequest); err != nil { - return nil, struct{}{}, err - } - req, err := http.NewRequest(http.MethodPost, client.Url(path), &buf) - if err != nil { - return nil, struct{}{}, err - } - req.Header.Set("Content-Type", "application/json; charset=UTF-8") - - res, err := client.Do(req) - - if err != nil { - return res, struct{}{}, err - } - - if res.StatusCode/100 != 2 { - bodyBytes, err := io.ReadAll(res.Body) - bodyReader := bytes.NewReader(bodyBytes) - if err != nil { - return res, struct{}{}, fmt.Errorf("failed to read response body: %w", err) - } - res.Body = io.NopCloser(bodyReader) - return res, struct{}{}, fmt.Errorf("unexpected status code: %d, %s", res.StatusCode, string(bodyBytes)) - } - - defer res.Body.Close() - - return res, struct{}{}, nil - -} - // Broadcast // // Sends a message to multiple users at any time.