Skip to content

Commit

Permalink
comments resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutisuryawanshigenesys committed Jul 26, 2024
1 parent f6ff842 commit 915a8e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func createIntegrationFacebookFn(ctx context.Context, p *integrationFacebookProx
// getAllIntegrationFacebookFn is the implementation for retrieving all integration facebook in Genesys Cloud
func getAllIntegrationFacebookFn(ctx context.Context, p *integrationFacebookProxy) (*[]platformclientv2.Facebookintegration, *platformclientv2.APIResponse, error) {
var allFacebookIntegrationRequests []platformclientv2.Facebookintegration
const pageSize = 100

facebookIntegrationRequests, resp, err := p.conversationsApi.GetConversationsMessagingIntegrationsFacebook(1, 100, "", "", "")
if err != nil {
Expand All @@ -112,7 +113,6 @@ func getAllIntegrationFacebookFn(ctx context.Context, p *integrationFacebookProx
allFacebookIntegrationRequests = append(allFacebookIntegrationRequests, *facebookIntegrationRequests.Entities...)

for pageNum := 2; pageNum <= *facebookIntegrationRequests.PageCount; pageNum++ {
const pageSize = 100

facebookIntegrationRequests, resp, err := p.conversationsApi.GetConversationsMessagingIntegrationsFacebook(pageNum, pageSize, "", "", "")
if err != nil {
Expand Down Expand Up @@ -149,7 +149,7 @@ func getIntegrationFacebookIdByNameFn(ctx context.Context, p *integrationFaceboo
}
}

return "", true, resp, fmt.Errorf("Unable to find integration facebook with name %s", name)
return "", true, resp, err
}

// getIntegrationFacebookByIdFn is an implementation of the function to get a Genesys Cloud integration facebook by Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func readIntegrationFacebook(ctx context.Context, d *schema.ResourceData, meta i
resourcedata.SetNillableValue(d, "page_id", facebookIntegrationRequest.PageId)
resourcedata.SetNillableValue(d, "app_id", facebookIntegrationRequest.AppId)

log.Printf("Read integration facebook")
log.Printf("Read integration facebook %s", *facebookIntegrationRequest.Name)
return cc.CheckState(d)
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ func getIntegrationFacebookFromResourceData(d *schema.ResourceData) platformclie
appId := d.Get("app_id").(string)
appSecret := d.Get("app_secret").(string)

if pageAccessToken != "" {
pageId = ""
userAccessToken = ""
} else {
pageAccessToken = ""
}
return platformclientv2.Facebookintegrationrequest{
Name: platformclientv2.String(d.Get("name").(string)),
SupportedContent: &platformclientv2.Supportedcontentreference{Id: &supportedContentId},
Expand Down

0 comments on commit 915a8e5

Please sign in to comment.