Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

docs(samples): added webhook sample #169

Merged
merged 38 commits into from Oct 14, 2021
Merged

docs(samples): added webhook sample #169

merged 38 commits into from Oct 14, 2021

Conversation

galz10
Copy link
Contributor

@galz10 galz10 commented Sep 14, 2021

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@galz10 galz10 requested a review from a team as a code owner September 14, 2021 19:22
@snippet-bot
Copy link

snippet-bot bot commented Sep 14, 2021

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the api: dialogflow Issues related to the googleapis/python-dialogflow-cx API. label Sep 14, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 14, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 14, 2021
Copy link
Contributor

@busunkim96 busunkim96 left a comment

Choose a reason for hiding this comment

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

Hi @galz10,

I chatted with some other Python samples owners during our office hours today about the dict/proto approach. (Thanks to @nicain for shedding more light on this as well!)

Given the unique nature of this feature (https://cloud.google.com/dialogflow/cx/docs/concept/webhook), we'll leave it up to the Product DPEs as to the best way to present it in samples.

Here are the pros/cons we discussed for each:

Proto Messages:

  • Pro: Able to validate request/response message against proto definition prior to it being sent to API.
  • Pro: Easier discovery of other fields/options when working through an IDE.
  • Con: Harder to work with for someone unfamiliar with GAPIC client. May be unnecessarily complex for simple request/response construction.

Dictionary:

  • Pro: More familiar format for folks who haven't worked with GAPIC libraries.
  • Pro: Dictionaries map naturally to request/response JSON objects.
  • Con: Increased chance of errors when messages become larger (have many fields set).

samples/snippets/webhook_test.py Show resolved Hide resolved
samples/snippets/webhook.py Show resolved Hide resolved
samples/snippets/webhook.py Outdated Show resolved Hide resolved
@galz10 galz10 requested a review from nicain October 13, 2021 19:45
@galz10 galz10 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 14, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 14, 2021
@galz10 galz10 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 14, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 14, 2021
samples/snippets/webhook.py Outdated Show resolved Hide resolved
@galz10 galz10 requested a review from nicain October 14, 2021 21:34
@nicain nicain merged commit 74cfc9a into googleapis:main Oct 14, 2021
@galz10 galz10 deleted the webhook branch October 14, 2021 22:19
gcf-merge-on-green bot pushed a commit that referenced this pull request Nov 9, 2021
🤖 I have created a release \*beep\* \*boop\*
---
## [1.6.0](https://www.github.com/googleapis/python-dialogflow-cx/compare/v1.5.0...v1.6.0) (2021-11-05)


### Features

* add support for python 3.10 ([#192](https://www.github.com/googleapis/python-dialogflow-cx/issues/192)) ([527b679](https://www.github.com/googleapis/python-dialogflow-cx/commit/527b679286ce7ed6481bf5c9258858473ca1f601))
* **v3:** added API for changelogs ([#197](https://www.github.com/googleapis/python-dialogflow-cx/issues/197)) ([4f41653](https://www.github.com/googleapis/python-dialogflow-cx/commit/4f41653b08a5be4aa6c871f285d941a2f43740a9))
* **v3beta1:** added API for changelogs ([#198](https://www.github.com/googleapis/python-dialogflow-cx/issues/198)) ([484e13a](https://www.github.com/googleapis/python-dialogflow-cx/commit/484e13a78830a3d0ce8b1745fdf2dfce0f88a21e))
* **v3beta1:** added support for comparing between versions ([#202](https://www.github.com/googleapis/python-dialogflow-cx/issues/202)) ([b8e16f8](https://www.github.com/googleapis/python-dialogflow-cx/commit/b8e16f8a17a49c1fc65f7f4392e33fb273bcd8ca))


### Bug Fixes

* **deps:** drop packaging dependency ([c44582e](https://www.github.com/googleapis/python-dialogflow-cx/commit/c44582e2fe3d49327bb0fc5ba05d2959b6965b7b))
* **deps:** require google-api-core >= 1.28.0 ([c44582e](https://www.github.com/googleapis/python-dialogflow-cx/commit/c44582e2fe3d49327bb0fc5ba05d2959b6965b7b))


### Documentation

* list oneofs in docstring ([c44582e](https://www.github.com/googleapis/python-dialogflow-cx/commit/c44582e2fe3d49327bb0fc5ba05d2959b6965b7b))
* **samples:** add voice selection ([#184](https://www.github.com/googleapis/python-dialogflow-cx/issues/184)) ([778b86f](https://www.github.com/googleapis/python-dialogflow-cx/commit/778b86f69e88ceb884bb9933128d2b14c6689174))
* **samples:** added webhook sample ([#169](https://www.github.com/googleapis/python-dialogflow-cx/issues/169)) ([74cfc9a](https://www.github.com/googleapis/python-dialogflow-cx/commit/74cfc9a7ab9b85fa05565c406534a3cd3391ab4f))
* **samples:** adds list training phrases sample ([#196](https://www.github.com/googleapis/python-dialogflow-cx/issues/196)) ([dfefa4e](https://www.github.com/googleapis/python-dialogflow-cx/commit/dfefa4e21bcd6bf37d341911187fab283152f514))
* **v3beta1:** clarified security settings API reference ([b8e16f8](https://www.github.com/googleapis/python-dialogflow-cx/commit/b8e16f8a17a49c1fc65f7f4392e33fb273bcd8ca))
* **v3:** clarified semantic of the streaming APIs ([4f41653](https://www.github.com/googleapis/python-dialogflow-cx/commit/4f41653b08a5be4aa6c871f285d941a2f43740a9))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: dialogflow Issues related to the googleapis/python-dialogflow-cx API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants