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 — CORS documentation missing setter · Issue #1838 · googleapis/google-cloud-python

CORS documentation missing setter #1838

New issue
Copy link
New issue
Copy link
Closed
Closed
CORS documentation missing setter#1838
Copy link
Assignees
daspecster
Labels
api: storageIssues related to the Cloud Storage API.

Description

@pdknsk
pdknsk
opened on May 31, 2016
Issue body actions

https://googlecloudplatform.github.io/gcloud-python/stable/storage-buckets.html#gcloud.storage.bucket.Bucket.cors

Retrieve CORS policies configured for this bucket.

It doesn't mention that it can also be set.

Activity

  1. pdknsk commented on May 31, 2016

    @pdknsk
    pdknsk
    on May 31, 2016
    Author
    More actions

    (I think this also applies to a few other properties.)

  2. tseaver
    added
    docs
    api: storageIssues related to the Cloud Storage API.
    on May 31, 2016
  3. daspecster commented on Jun 1, 2016

    @daspecster
    daspecster
    on Jun 1, 2016
    Contributor
    More actions

    @tseaver https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/gcloud/storage/bucket.py#L509 is it just not showing up in the docs because of the decorator?

  4. tseaver commented on Jun 2, 2016

    @tseaver
    tseaver
    on Jun 2, 2016
    Contributor
    More actions

    @daspecster Docstrings for @property objects are derived from their getters:

    >>> class Foo(object):
    ...     @property
    ...     def bar(self):
    ...         """bar getter"""
    ...     @bar.setter
    ...     def bar(self, value):
    ...         """bar setter"""
    ...     @bar.deleter
    ...     def bar(self):
    ...         """bar deleter"""
    ... 
    >>> Foo.bar
    <property object at 0x7f8fe9a856d8>
    >>> Foo.bar.__doc__
    'bar getter'
  5. daspecster commented on Jun 2, 2016

    @daspecster
    daspecster
    on Jun 2, 2016
    Contributor
    More actions

    Cool, what if we just combine the docs in some way that makes sense in the getter?

        @property
        def cors(self):
            """Get/Set CORS policies configured for this bucket.
            See: http://www.w3.org/TR/cors/ and
                 https://cloud.google.com/storage/docs/json_api/v1/buckets
    
            :setter: Set CORS policies for this bucket.
            :getter: Gets the CORS policies for this bucket.
    
            """
            return [copy.deepcopy(policy)
                    for policy in self._properties.get('cors', ())]
    
        @cors.setter
        def cors(self, entries):
            """Set CORS policies configured for this bucket.
            See: http://www.w3.org/TR/cors/ and
                 https://cloud.google.com/storage/docs/json_api/v1/buckets
            :type entries: list of dictionaries
            :param entries: A sequence of mappings describing each CORS policy.
            """
            self._patch_property('cors', entries)
    Reacted by Mike Lissner
  6. mlissner commented on Oct 26, 2016

    @mlissner
    mlissner
    on Oct 26, 2016
    Contributor
    More actions

    I filed #2610 where the same issue applies to the setter for lifecycle_rules. Seems like a very simple solution here is what @daspecster proposed. It's not perfect, but if it had been done back in June when it was proposed, I would have been a happier customer.

  7. daspecster
    added a commit that references this issue on Oct 26, 2016

    Mention that cors property has a setter. Fixes googleapis#1838

    This issue will close once commit 476ab7d is merged into the 'master' branch.
    476ab7d
  8. daspecster commented on Oct 26, 2016

    @daspecster
    daspecster
    on Oct 26, 2016
    Contributor
    More actions

    @mlissner, sorry you lost cycles on this.

    I made #2623 to hopefully resolve this for future users.

    Thanks for reporting as well.

    Reacted by Mike Lissner
  9. daspecster
    closed this as completedin 476ab7don Oct 27, 2016
  10. richkadel
    added a commit that references this issue on May 6, 2017

    Mention that cors property has a setter. Fixes googleapis#1838

    This issue will close once commit a935c19 is merged into the 'master' branch.
    a935c19
  11. JustinBeckwith
    assigned
    daspecster
    on Feb 1, 2021
  12. parthea
    added 2 commits that reference this issue on Nov 26, 2025

    feat: onboard `google-auth` to librarian (#1838)

    43e63d9

    chore: librarian release pull request: 20251105T230735Z (#1863)

    475513c
  13. parthea
    added 2 commits that reference this issue on Mar 6, 2026

    fix: correct type checking (#1848)

    This issue will close once commit 769b64b is merged into the 'main' branch.
    769b64b

    Mention that cors property has a setter. Fixes #1838

    This issue will close once commit 482be80 is merged into the 'main' branch.
    482be80
  14. parthea
    added a commit that references this issue on Apr 1, 2026

    fix: revert dict back to protobuf in the iam binding update (#1838)

    b293064
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @daspecster
    daspecster

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.