Update *ListResponse structs to match API responses#425
Merged
patryk merged 2 commits intocloudflare:masterfrom Mar 9, 2020
Merged
Update *ListResponse structs to match API responses#425patryk merged 2 commits intocloudflare:masterfrom
*ListResponse structs to match API responses#425patryk merged 2 commits intocloudflare:masterfrom
Conversation
When the work for terraform-providers/terraform-provider-cloudflare#597 was started, the `messages` object was either empty array or a single string (per the original `cloudflare.Response`[1] struct) but the API response is now spitting out an array of `message` objects inside of the current array. To fix the issue, the two structs have been updated to conform to the required objects. [1]: https://github.com/cloudflare/cloudflare-go/blob/master/cloudflare.go#L363
patryk
approved these changes
Mar 9, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the work for
terraform-providers/terraform-provider-cloudflare#597 was started,
the
messagesobject was either empty array or a single string (perthe original
cloudflare.Responsestruct) but the API response isnow spitting out an array of
messageobjects inside of the currentarray.
old
{ "result": { "id": "566f1f64-3b1e-40b3-ae1b-807396f1a107", "type": "github", "uid": "566f1f64-3b1e-40b3-ae1b-807396f1a107", "name": "ytypfrkona", "config": { "client_id": "test", "client_secret": "**********************************", "redirect_url": "https://my-domain.cloudflareaccess.com/cdn-cgi/access/callback" }, "version": "267eb3e7f2fc57dae9792a2315895d69" }, "success": true, "errors": [], "messages": [] }new
{ "result": { "id": "e0d1a74b-5b19-4dc8-823c-d1f2d42b01b3", "type": "github", "uid": "e0d1a74b-5b19-4dc8-823c-d1f2d42b01b3", "name": "iumxxidzao-updated", "config": { "client_id": "test", "client_secret": "**********************************", "redirect_url": "https://my-domain.cloudflareaccess.com/cdn-cgi/access/callback" }, "version": "413f20d9ecce0e7b361843841764492a" }, "success": true, "errors": [], "messages": [ { "message": "Finish enterprise enablement by going to https://my-domain.cloudflareaccess.com/cdn-cgi/access/enterprise-setup/ZTBkMWE3NGItNWIxOS00ZGM4LTgyM2MtZDFmMmQ0MmIwMWIz246b90e12e49a1ed82f16be7f4433da49b7bd15ad7cea7fd96ee9cef81e571f45e6554b7" } ] }To fix the issue, the two structs have been updated to conform to the
required objects.