From 720a97231c593182e13c7c110b51ca6f51bd8450 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 21 Apr 2025 07:36:53 +0000 Subject: [PATCH] Code are generated by openapi generator --- line-openapi | 2 +- .../manage_audience/.openapi-generator/FILES | 3 - .../manage_audience/api_manage_audience.go | 192 +----------------- 3 files changed, 10 insertions(+), 187 deletions(-) diff --git a/line-openapi b/line-openapi index 2f380581..bc181f4c 160000 --- a/line-openapi +++ b/line-openapi @@ -1 +1 @@ -Subproject commit 2f38058136b8f9237feafe34ea86a4be98455fb3 +Subproject commit bc181f4c552508ff67e33d74d996ebf624014938 diff --git a/linebot/manage_audience/.openapi-generator/FILES b/linebot/manage_audience/.openapi-generator/FILES index 6df2811c..94177ead 100644 --- a/linebot/manage_audience/.openapi-generator/FILES +++ b/linebot/manage_audience/.openapi-generator/FILES @@ -4,7 +4,6 @@ model_adaccount.go model_add_audience_to_audience_group_request.go model_audience.go model_audience_group.go -model_audience_group_authority_level.go model_audience_group_create_route.go model_audience_group_failed_type.go model_audience_group_job.go @@ -24,9 +23,7 @@ model_detailed_owner.go model_error_detail.go model_error_response.go model_get_audience_data_response.go -model_get_audience_group_authority_level_response.go model_get_audience_groups_response.go model_get_shared_audience_data_response.go model_get_shared_audience_groups_response.go -model_update_audience_group_authority_level_request.go model_update_audience_group_description_request.go diff --git a/linebot/manage_audience/api_manage_audience.go b/linebot/manage_audience/api_manage_audience.go index 244ea379..2f9a1a13 100644 --- a/linebot/manage_audience/api_manage_audience.go +++ b/linebot/manage_audience/api_manage_audience.go @@ -116,69 +116,6 @@ func WithEndpoint(endpoint string) ManageAudienceAPIOption { } } -// ActivateAudienceGroup -// -// Activate audience -// Parameters: -// audienceGroupId The audience ID. - -// https://developers.line.biz/en/reference/messaging-api/#activate-audience-group -func (client *ManageAudienceAPI) ActivateAudienceGroup( - - audienceGroupId int64, - -) (struct{}, error) { - _, body, error := client.ActivateAudienceGroupWithHttpInfo( - - audienceGroupId, - ) - return body, error -} - -// ActivateAudienceGroup -// If you want to take advantage of the HTTPResponse object for status codes and headers, use this signature. -// -// Activate audience -// Parameters: -// audienceGroupId The audience ID. - -// https://developers.line.biz/en/reference/messaging-api/#activate-audience-group -func (client *ManageAudienceAPI) ActivateAudienceGroupWithHttpInfo( - - audienceGroupId int64, - -) (*http.Response, struct{}, error) { - path := "/v2/bot/audienceGroup/{audienceGroupId}/activate" - - path = strings.Replace(path, "{audienceGroupId}", strconv.FormatInt(audienceGroupId, 10), -1) - - req, err := http.NewRequest(http.MethodPut, client.Url(path), nil) - if err != nil { - return nil, struct{}{}, err - } - - 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 - -} - // AddAudienceToAudienceGroup // // Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) @@ -593,59 +530,6 @@ func (client *ManageAudienceAPI) GetAudienceDataWithHttpInfo( } -// GetAudienceGroupAuthorityLevel -// -// Get the authority level of the audience -// Parameters: - -// https://developers.line.biz/en/reference/messaging-api/#get-authority-level -func (client *ManageAudienceAPI) GetAudienceGroupAuthorityLevel() (*GetAudienceGroupAuthorityLevelResponse, error) { - _, body, error := client.GetAudienceGroupAuthorityLevelWithHttpInfo() - return body, error -} - -// GetAudienceGroupAuthorityLevel -// If you want to take advantage of the HTTPResponse object for status codes and headers, use this signature. -// -// Get the authority level of the audience -// Parameters: - -// https://developers.line.biz/en/reference/messaging-api/#get-authority-level -func (client *ManageAudienceAPI) GetAudienceGroupAuthorityLevelWithHttpInfo() (*http.Response, *GetAudienceGroupAuthorityLevelResponse, error) { - path := "/v2/bot/audienceGroup/authorityLevel" - - req, err := http.NewRequest(http.MethodGet, client.Url(path), nil) - if err != nil { - return nil, nil, err - } - - 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 := GetAudienceGroupAuthorityLevelResponse{} - if err := decoder.Decode(&result); err != nil { - return res, nil, fmt.Errorf("failed to decode JSON: %w", err) - } - return res, &result, nil - -} - // GetAudienceGroups // // Gets data for more than one audience. @@ -841,6 +725,7 @@ func (client *ManageAudienceAPI) GetSharedAudienceDataWithHttpInfo( // status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. // size The number of audiences per page. Default: 20 Max: 40 // createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. +// includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager // https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list func (client *ManageAudienceAPI) GetSharedAudienceGroups( @@ -855,6 +740,8 @@ func (client *ManageAudienceAPI) GetSharedAudienceGroups( createRoute AudienceGroupCreateRoute, + includesOwnedAudienceGroups bool, + ) (*GetSharedAudienceGroupsResponse, error) { _, body, error := client.GetSharedAudienceGroupsWithHttpInfo( @@ -867,6 +754,8 @@ func (client *ManageAudienceAPI) GetSharedAudienceGroups( size, createRoute, + + includesOwnedAudienceGroups, ) return body, error } @@ -881,6 +770,7 @@ func (client *ManageAudienceAPI) GetSharedAudienceGroups( // status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. // size The number of audiences per page. Default: 20 Max: 40 // createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. +// includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager // https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list func (client *ManageAudienceAPI) GetSharedAudienceGroupsWithHttpInfo( @@ -895,6 +785,8 @@ func (client *ManageAudienceAPI) GetSharedAudienceGroupsWithHttpInfo( createRoute AudienceGroupCreateRoute, + includesOwnedAudienceGroups bool, + ) (*http.Response, *GetSharedAudienceGroupsResponse, error) { path := "/v2/bot/audienceGroup/shared/list" @@ -911,6 +803,7 @@ func (client *ManageAudienceAPI) GetSharedAudienceGroupsWithHttpInfo( query.Add("status", string(status)) query.Add("size", strconv.FormatInt(size, 10)) query.Add("createRoute", string(createRoute)) + query.Add("includesOwnedAudienceGroups", strconv.FormatBool(includesOwnedAudienceGroups)) req.URL.RawQuery = query.Encode() @@ -941,73 +834,6 @@ func (client *ManageAudienceAPI) GetSharedAudienceGroupsWithHttpInfo( } -// UpdateAudienceGroupAuthorityLevel -// -// Change the authority level of the audience -// Parameters: -// updateAudienceGroupAuthorityLevelRequest - -// https://developers.line.biz/en/reference/messaging-api/#change-authority-level -func (client *ManageAudienceAPI) UpdateAudienceGroupAuthorityLevel( - - updateAudienceGroupAuthorityLevelRequest *UpdateAudienceGroupAuthorityLevelRequest, - -) (struct{}, error) { - _, body, error := client.UpdateAudienceGroupAuthorityLevelWithHttpInfo( - - updateAudienceGroupAuthorityLevelRequest, - ) - return body, error -} - -// UpdateAudienceGroupAuthorityLevel -// If you want to take advantage of the HTTPResponse object for status codes and headers, use this signature. -// -// Change the authority level of the audience -// Parameters: -// updateAudienceGroupAuthorityLevelRequest - -// https://developers.line.biz/en/reference/messaging-api/#change-authority-level -func (client *ManageAudienceAPI) UpdateAudienceGroupAuthorityLevelWithHttpInfo( - - updateAudienceGroupAuthorityLevelRequest *UpdateAudienceGroupAuthorityLevelRequest, - -) (*http.Response, struct{}, error) { - path := "/v2/bot/audienceGroup/authorityLevel" - - var buf bytes.Buffer - enc := json.NewEncoder(&buf) - if err := enc.Encode(updateAudienceGroupAuthorityLevelRequest); err != nil { - return nil, struct{}{}, err - } - req, err := http.NewRequest(http.MethodPut, 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 - -} - // UpdateAudienceGroupDescription // // Renames an existing audience.