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

Features/result #38

Merged
merged 12 commits into from
Oct 10, 2022
Merged

Features/result #38

merged 12 commits into from
Oct 10, 2022

Conversation

mardiros
Copy link
Owner

@mardiros mardiros commented Oct 8, 2022

/!\ API Break

This pull request change the response type on all method to wrap response in a "Result" object.

As a result, we have:

  • the same API for the collection and non collection result.
  • No exception raised to control the http error flow.
    • there are still a lot of exception raised for registration, contracts and so on that appears only while developping, integrating API
    api = await cli("gandi")
    if len(sys.argv) == 2:
        domain = sys.argv[1]
        domain_result = await api.domain.get(DomainParam(name=domain))
        domain = domain_result.unwrap()
        print(domain)
    else:
        domain_result = await api.domain.collection_get()
        domains = domain_result.unwrap()
        print(domains.meta)
        print()
        for domain in domains:
            print(domain)

  • Update the code
  • Update examples code
  • Update the documentation

Fixes #30

@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2022

Codecov Report

Merging #38 (2373e5d) into main (ebd35fb) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #38   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           46        46           
  Lines         1478      1533   +55     
=========================================
+ Hits          1478      1533   +55     
Impacted Files Coverage Δ
src/blacksmith/domain/exceptions.py 100.00% <100.00%> (ø)
src/blacksmith/domain/model/params.py 100.00% <100.00%> (ø)
src/blacksmith/sd/_async/adapters/consul.py 100.00% <100.00%> (ø)
src/blacksmith/sd/_sync/adapters/consul.py 100.00% <100.00%> (ø)
src/blacksmith/service/_async/route_proxy.py 100.00% <100.00%> (ø)
src/blacksmith/service/_sync/route_proxy.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

yanndinendal
yanndinendal approved these changes Oct 10, 2022
Copy link
Contributor

@yanndinendal yanndinendal left a comment

Choose a reason for hiding this comment

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

👍️

@olivier-m
Copy link

👍

@mardiros mardiros merged commit 2373e5d into main Oct 10, 2022
@mardiros mardiros deleted the features/result branch January 21, 2024 22:31
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.

Fix ResponseBox and CollectionIterator inconcistency
4 participants