Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RawResponse method which returns the standard Response with Result #1355

Merged
merged 4 commits into from Aug 8, 2023

Conversation

slester
Copy link
Contributor

@slester slester commented Aug 2, 2023

We are manually tagging workers using an API that is not yet a part of the Go library (see #1354), but we don't have access to the response's Error, Messages, etc. when using the Raw() method, since it just returns the "result" field. This also returns the Response if applicable (Success, Errors, etc.)

Description

Simply added a new method that returned r instead of r.Result

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented in cloudflare/api-schemas
    and relies on stable APIs.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

changelog detected ✅

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2023

Codecov Report

Merging #1355 (1e8204b) into master (b9ac804) will increase coverage by 0.17%.
Report is 119 commits behind head on master.
The diff coverage is 57.10%.

@@            Coverage Diff             @@
##           master    #1355      +/-   ##
==========================================
+ Coverage   48.33%   48.50%   +0.17%     
==========================================
  Files         133      136       +3     
  Lines       13023    13239     +216     
==========================================
+ Hits         6295     6422     +127     
- Misses       5201     5261      +60     
- Partials     1527     1556      +29     
Files Changed Coverage Δ
access_application.go 72.72% <ø> (ø)
access_audit_log.go 79.31% <ø> (ø)
access_bookmark.go 72.44% <ø> (ø)
access_ca_certificate.go 68.00% <ø> (ø)
access_group.go 70.00% <ø> (ø)
access_identity_provider.go 66.32% <ø> (ø)
access_keys.go 71.42% <ø> (ø)
access_mutual_tls_certificates.go 68.86% <ø> (ø)
access_organization.go 53.84% <ø> (ø)
access_service_tokens.go 51.85% <ø> (ø)
... and 118 more

@jacobbednarz
Copy link
Member

given Raw and RawResponse are basically the same thing with a different part of the response returned, is there a reason we don't modify Raw to return the entire payload instead?

@slester
Copy link
Contributor Author

slester commented Aug 4, 2023

given Raw and RawResponse are basically the same thing with a different part of the response returned, is there a reason we don't modify Raw to return the entire payload instead?

I'm totally up for that! I just didn't want to break existing APIs.

@jacobbednarz
Copy link
Member

for a low level method like this, I think it is fine. just be sure to include a changelog entry and 🚀

@slester
Copy link
Contributor Author

slester commented Aug 8, 2023

@jacobbednarz - thanks for the input, I've made those changes.

@jacobbednarz jacobbednarz merged commit 105f15b into cloudflare:master Aug 8, 2023
11 checks passed
@github-actions github-actions bot added this to the v0.75.0 milestone Aug 8, 2023
github-actions bot pushed a commit that referenced this pull request Aug 8, 2023
@github-actions
Copy link
Contributor

This functionality has been released in v0.75.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants