Skip to content

Commit

Permalink
Remove obsolete feature: Audience Match (#530)
Browse files Browse the repository at this point in the history
line/line-openapi#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 <[email protected]>
Co-authored-by: Yuta Kasai <[email protected]>
  • Loading branch information
3 people authored Jan 20, 2025
1 parent bc19dc7 commit a5e62df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 68 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ _testmain.go
.idea*

/.vscode/

# github workflow
pr_info.json
1 change: 0 additions & 1 deletion linebot/messaging_api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 0 additions & 67 deletions linebot/messaging_api/api_messaging_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a5e62df

Please sign in to comment.