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

feat: support structpb.Struct as req/resp #2632

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

codyoss
Copy link
Member

@codyoss codyoss commented Jun 12, 2024

There are some APIs that have started to use this type for the request and/or respsonse. Similar to how we had to specially handle protos HTTP body we need a good translation for this type as well. map[string]any seemed like the best fit as that is the input needed to create a Struct. The other choice would have been a googleapis.RawMessage. RawMessage is used today when a field would be of type Struct, but this is a less convient type, and less precise type, to use than a map directly.

Fixes: #2601

There are some APIs that have started to use this type for the
request and/or respsonse. Similar to how we had to specially handle
protos HTTP body we need a good translation for this type as well.
`map[string]any` seemed like the best fit as that is the input
needed to create a `Struct`. The other choice would have been a
`googleapis.RawMessage`. RawMessage is used today when a field
would be of type Struct, but this is a less convient type, and less
precise type, to use than a map directly.

Fixes: googleapis#2601
@codyoss codyoss requested review from yoshi-approver and a team as code owners June 12, 2024 14:23
@codyoss codyoss added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 12, 2024
Copy link
Member

@quartzmo quartzmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@noahdietz noahdietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I like it

google-api-go-generator/gen.go Outdated Show resolved Hide resolved
Co-authored-by: Noah Dietz <noahdietz@users.noreply.github.com>
@codyoss codyoss added the automerge Merge the pull request once unit tests and other checks pass. label Jun 12, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 12, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit ebc44d1 into googleapis:main Jun 12, 2024
5 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 12, 2024
abs3ntdev pushed a commit to abs3ntdev/gspot that referenced this pull request Jul 6, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | require | minor | `v0.182.0` -> `v0.187.0` |

---

### Release Notes

<details>
<summary>googleapis/google-api-go-client (google.golang.org/api)</summary>

### [`v0.187.0`](https://github.com/googleapis/google-api-go-client/releases/tag/v0.187.0)

[Compare Source](googleapis/google-api-go-client@v0.186.0...v0.187.0)

##### Features

-   **all:** Auto-regenerate discovery clients ([#&#8203;2655](googleapis/google-api-go-client#2655)) ([1a28e06](googleapis/google-api-go-client@1a28e06))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2658](googleapis/google-api-go-client#2658)) ([719f988](googleapis/google-api-go-client@719f988))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2659](googleapis/google-api-go-client#2659)) ([7cd88da](googleapis/google-api-go-client@7cd88da))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2660](googleapis/google-api-go-client#2660)) ([3ca2f84](googleapis/google-api-go-client@3ca2f84))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2661](googleapis/google-api-go-client#2661)) ([0a238f5](googleapis/google-api-go-client@0a238f5))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2663](googleapis/google-api-go-client#2663)) ([6e061ce](googleapis/google-api-go-client@6e061ce))

##### Bug Fixes

-   **gensupport:** Wrap chunk upload err for retries ([#&#8203;2657](googleapis/google-api-go-client#2657)) ([a758bc1](googleapis/google-api-go-client@a758bc1))
-   Pass through gRPC api key option to new auth lib ([#&#8203;2664](googleapis/google-api-go-client#2664)) ([e051997](googleapis/google-api-go-client@e051997))

### [`v0.186.0`](https://github.com/googleapis/google-api-go-client/releases/tag/v0.186.0)

[Compare Source](googleapis/google-api-go-client@v0.185.0...v0.186.0)

##### Features

-   **all:** Auto-regenerate discovery clients ([#&#8203;2641](googleapis/google-api-go-client#2641)) ([72fb128](googleapis/google-api-go-client@72fb128))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2644](googleapis/google-api-go-client#2644)) ([20ffdd8](googleapis/google-api-go-client@20ffdd8))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2645](googleapis/google-api-go-client#2645)) ([c1a7681](googleapis/google-api-go-client@c1a7681))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2648](googleapis/google-api-go-client#2648)) ([1bac79d](googleapis/google-api-go-client@1bac79d))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2649](googleapis/google-api-go-client#2649)) ([695484b](googleapis/google-api-go-client@695484b))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2652](googleapis/google-api-go-client#2652)) ([10c47f3](googleapis/google-api-go-client@10c47f3))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2653](googleapis/google-api-go-client#2653)) ([bc370a7](googleapis/google-api-go-client@bc370a7))

### [`v0.185.0`](https://github.com/googleapis/google-api-go-client/releases/tag/v0.185.0)

[Compare Source](googleapis/google-api-go-client@v0.184.0...v0.185.0)

##### Features

-   **all:** Auto-regenerate discovery clients ([#&#8203;2636](googleapis/google-api-go-client#2636)) ([51ff8a4](googleapis/google-api-go-client@51ff8a4))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2638](googleapis/google-api-go-client#2638)) ([0c868b2](googleapis/google-api-go-client@0c868b2))

##### Bug Fixes

-   **internal/gensupport:** Update shouldRetry for GCS uploads ([#&#8203;2634](googleapis/google-api-go-client#2634)) ([ea513cb](googleapis/google-api-go-client@ea513cb))

### [`v0.184.0`](https://github.com/googleapis/google-api-go-client/releases/tag/v0.184.0)

[Compare Source](googleapis/google-api-go-client@v0.183.0...v0.184.0)

##### Features

-   **all:** Auto-regenerate discovery clients ([#&#8203;2624](googleapis/google-api-go-client#2624)) ([7fccba6](googleapis/google-api-go-client@7fccba6))
-   Regen cloudcommerceprocurement v1 from updated discovery file ([#&#8203;2627](googleapis/google-api-go-client#2627)) ([7e30ed2](googleapis/google-api-go-client@7e30ed2))
-   Support structpb.Struct as req/resp ([#&#8203;2632](googleapis/google-api-go-client#2632)) ([ebc44d1](googleapis/google-api-go-client@ebc44d1)), refs [#&#8203;2601](googleapis/google-api-go-client#2601)

##### Bug Fixes

-   **cba:** Update credsNewAuth to support oauth2 over mTLS ([#&#8203;2610](googleapis/google-api-go-client#2610)) ([953f728](googleapis/google-api-go-client@953f728))

### [`v0.183.0`](https://github.com/googleapis/google-api-go-client/releases/tag/v0.183.0)

[Compare Source](googleapis/google-api-go-client@v0.182.0...v0.183.0)

##### Features

-   **all:** Auto-regenerate discovery clients ([#&#8203;2611](googleapis/google-api-go-client#2611)) ([1de148b](googleapis/google-api-go-client@1de148b))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2616](googleapis/google-api-go-client#2616)) ([5f21214](googleapis/google-api-go-client@5f21214))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2617](googleapis/google-api-go-client#2617)) ([08fdd71](googleapis/google-api-go-client@08fdd71))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2619](googleapis/google-api-go-client#2619)) ([c7f1614](googleapis/google-api-go-client@c7f1614))
-   **all:** Auto-regenerate discovery clients ([#&#8203;2622](googleapis/google-api-go-client#2622)) ([0077748](googleapis/google-api-go-client@0077748))

##### Bug Fixes

-   Add another temporary dep on genproto ([#&#8203;2614](googleapis/google-api-go-client#2614)) ([4f98211](googleapis/google-api-go-client@4f98211)), refs [#&#8203;2559](googleapis/google-api-go-client#2559) [#&#8203;2613](googleapis/google-api-go-client#2613)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjQuMyIsInVwZGF0ZWRJblZlciI6IjM3LjQyNC4zIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Co-authored-by: Renovate Bot <renovate-bot@gitea.com>
Reviewed-on: https://git.asdf.cafe/abs3nt/gspot/pulls/9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly support "strong typed maps" in generator
4 participants