Skip to content

Commit

Permalink
fix(key transaction): update in variable names and case in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vagrawal-newrelic committed Oct 9, 2024
1 parent d2a41df commit 71dc706
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions newrelic/data_source_newrelic_key_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func dataSourceNewRelicKeyTransaction() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "guid of the key transaction in New Relic.",
Description: "GUID of the key transaction in New Relic.",
},
"domain": {
Type: schema.TypeString,
Expand Down Expand Up @@ -59,16 +59,16 @@ func dataSourceNewRelicKeyTransactionRead(ctx context.Context, d *schema.Resourc
query = fmt.Sprintf("%s AND id = '%s'", query, guid)
}

transaction, err := client.Entities.GetEntitySearchByQueryWithContext(ctx, entities.EntitySearchOptions{}, query, []entities.EntitySearchSortCriteria{})
keyTransactionsFound, err := client.Entities.GetEntitySearchByQueryWithContext(ctx, entities.EntitySearchOptions{}, query, []entities.EntitySearchSortCriteria{})
if err != nil {
return diag.FromErr(err)
}

if transaction == nil || len(transaction.Results.Entities) == 0 {
if keyTransactionsFound == nil || len(keyTransactionsFound.Results.Entities) == 0 {
return diag.FromErr(fmt.Errorf("no key transaction that matches the specified parameters is found in New Relic"))
}

flattenKeyTransaction(transaction, d)
flattenKeyTransaction(keyTransactionsFound, d)

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/key_transaction.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The following arguments are supported:
* `name` - (Required) The name of the key transaction in New Relic.
* `guid` - (Optional) GUID of the key transaction in New Relic.

-> **NOTE** If the `name` specified in the configuration matches the names of multiple key transaction in the account, the data source will return the first match from the list of all matching key transaction retrieved from the API. However, when using the `guid` argument as the search criterion, only the key transaction with that particular guid is returned, as each key transaction has a unique guid.
-> **NOTE** If the `name` specified in the configuration matches the names of multiple key transactions in the account, the data source will return the first match from the list of all matching key transactions retrieved from the API. However, when using the `guid` argument as the search criterion, only the key transaction with that particular GUID is returned, as each key transaction has a unique GUID.

## Attributes Reference

Expand Down

0 comments on commit 71dc706

Please sign in to comment.