GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Access Display Names of enum fields via enum object by beccasaurus · Pull Request #1738 · GoogleCloudPlatform/python-docs-samples

Conversation

@beccasaurus

@beccasaurus beccasaurus commented Oct 5, 2018

Copy link
Copy Markdown
Contributor

To get the display name of enum fields of protobuf objects, we had been copy/pasting the enum field names from the .proto into our code and using the int index of the enum field to get the display name

Updated various samples to get enum field display names the newer, improved way:

from google.cloud.mylibrary import enums

enum_object = enums.EnumName(response.enum_field)

print('The display name of enum_field is: {}'.format(enum_object.name))

Related: googleapis/google-cloud-python#6169

Language library needed to be updated to make use of this feature. Worked out-of-the-box for Video Intelligence and Text-to-Speech

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Rebecca Taylor added 4 commits October 5, 2018 14:20
Rebecca Taylor
Get display name of enums using IntEnum
eb77790
Requires updating google-cloud-language to 1.1.0
Rebecca Taylor
Add note about gs://demomaker for video test files
39d9bff
Rebecca Taylor
Get display name of enums using IntEnum
751a0b1
Rebecca Taylor
Get display name of enums using IntEnum
9971fb7
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 5, 2018
@beccasaurus beccasaurus mentioned this pull request Oct 5, 2018
Language: add support for accessing ENUM display names googleapis/google-cloud-python#6169
Closed
@agile-bex
Merge branch 'master' into use-IntEnum-to-get-enum-display-names
0cee4bf
@beccasaurus
beccasaurus requested review from alixhami, dizcology and nnegrey October 5, 2018 23:13
alixhami
alixhami reviewed Oct 9, 2018
View reviewed changes
Comment thread video/cloud-client/analyze/analyze_test.py Outdated
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']


# Videos used for these tests can be found in the gs://demomaker/ public bucket

@alixhami alixhami Oct 9, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm going to send a PR to update these tests to explicitly use the demomaker bucket to save future contributor friction, so this comment will no longer be necessary. Please remove so we can avoid merge conflicts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Rebecca Taylor added 2 commits October 9, 2018 15:02
Rebecca Taylor
Revert "Add note about gs://demomaker for video test files"
eda7eca
This reverts commit 39d9bff.
Rebecca Taylor
Merge branch 'use-IntEnum-to-get-enum-display-names' of github.com:Go…
0a026b7
…ogleCloudPlatform/python-docs-samples into use-IntEnum-to-get-enum-display-names
@alixhami alixhami mentioned this pull request Oct 9, 2018
Use explicit URIs for Video Intelligence sample tests #1743
Merged
alixhami
alixhami approved these changes Oct 10, 2018
View reviewed changes
agile-bex and others added 5 commits October 11, 2018 12:07
@agile-bex
Merge branch 'master' into use-IntEnum-to-get-enum-display-names
1b8117b
@agile-bex
Merge branch 'master' into use-IntEnum-to-get-enum-display-names
ecd2bb2
Rebecca Taylor
Merge branch 'master' into use-IntEnum-to-get-enum-display-names
f436262
Rebecca Taylor
Merge branch 'use-IntEnum-to-get-enum-display-names' of github.com:Go…
5a0d120
…ogleCloudPlatform/python-docs-samples into use-IntEnum-to-get-enum-display-names
@agile-bex
Merge branch 'master' into use-IntEnum-to-get-enum-display-names
85cf22e
@beccasaurus
beccasaurus merged commit 8d79fd1 into master Oct 15, 2018
@beccasaurus
beccasaurus deleted the use-IntEnum-to-get-enum-display-names branch October 15, 2018 20:53
busunkim96 pushed a commit to googleapis/python-texttospeech that referenced this pull request Apr 9, 2020
@agile-bex
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
66e6a42
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to googleapis/python-texttospeech that referenced this pull request May 13, 2020
@agile-bex
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
0040f6f
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to googleapis/python-texttospeech that referenced this pull request May 13, 2020
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
f0f233f
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to googleapis/python-texttospeech that referenced this pull request May 13, 2020
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
c540c5f
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to busunkim96/python-language that referenced this pull request May 20, 2020
@agile-bex
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
6532369
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to busunkim96/python-videointelligence that referenced this pull request May 20, 2020
@agile-bex
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
f3d7dae
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to googleapis/python-texttospeech that referenced this pull request May 20, 2020
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
d5e0ef9
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to googleapis/python-texttospeech that referenced this pull request May 20, 2020
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
68c37d2
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
hkdevandla pushed a commit to hkdevandla/python-language that referenced this pull request Sep 26, 2020
@agile-bex
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
9b7c0ed
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
busunkim96 pushed a commit to googleapis/python-language that referenced this pull request Sep 29, 2020
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
92e409d
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
danoscarmike pushed a commit to googleapis/python-videointelligence that referenced this pull request Sep 30, 2020
@agile-bex @danoscarmike
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
77cc895
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
@msampathkumar msampathkumar mentioned this pull request Nov 10, 2022
migrate code from googleapis/python-texttospeech #8483
Merged
8 tasks
msampathkumar pushed a commit that referenced this pull request Nov 10, 2022
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](#1738)
2868c01
* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bff.
m-strzelczyk pushed a commit that referenced this pull request Nov 18, 2022
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](#1738)
7a99445
* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bff.
@m-strzelczyk m-strzelczyk mentioned this pull request Nov 18, 2022
migrate code from googleapis/python-language #8533
Merged
8 tasks
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Jul 6, 2023
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
9ba6c43
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
dizcology pushed a commit that referenced this pull request Sep 11, 2023
@agile-bex @danoscarmike
Access Display Names of enum fields via enum object [(#1738)](#1738)
398a29d
* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bff.
@dizcology dizcology mentioned this pull request Sep 11, 2023
migrate code from googleapis/python-videointelligence #10605
Merged
9 tasks
leahecole pushed a commit that referenced this pull request Sep 15, 2023
@agile-bex @leahecole
Access Display Names of enum fields via enum object [(#1738)](#1738)
b55020e
* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bff.
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Sep 22, 2023
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
4725041
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Sep 22, 2023
@agile-bex @busunkim96
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
251b0aa
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Sep 22, 2023
@agile-bex @danoscarmike
Access Display Names of enum fields via enum object [(#1738)](GoogleC…
eb6f109
…loudPlatform/python-docs-samples#1738)

* Get display name of enums using IntEnum

Requires updating google-cloud-language to 1.1.0

* Add note about gs://demomaker for video test files

* Get display name of enums using IntEnum

* Get display name of enums using IntEnum

* Revert "Add note about gs://demomaker for video test files"

This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alixhami alixhami alixhami approved these changes
@dizcology dizcology Awaiting requested review from dizcology
@nnegrey nnegrey Awaiting requested review from nnegrey

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@beccasaurus @alixhami @googlebot @agile-bex
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.