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: add Webhooks and Organization Webhooks API methods #40

Merged
merged 4 commits into from
May 23, 2024

Conversation

vorobeyme
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

Attention: Patch coverage is 55.00000% with 36 lines in your changes are missing coverage. Please review.

Project coverage is 50.87%. Comparing base (21d94a8) to head (eafa55f).

Files Patch % Lines
crowdin/model/webhooks.go 0.00% 32 Missing ⚠️
crowdin/webhooks.go 91.31% 1 Missing and 1 partial ⚠️
crowdin/webhooks_organization.go 91.31% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
+ Coverage   50.56%   50.87%   +0.31%     
==========================================
  Files          46       49       +3     
  Lines        2419     2499      +80     
==========================================
+ Hits         1223     1271      +48     
- Misses       1130     1162      +32     
  Partials       66       66              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


// UnmarshalJSON unmarshals the JSON data into the Webhook structure.
// Headers property can be either an object (map) or an empty array.
func (w *Webhook) UnmarshalJSON(data []byte) error {
Copy link
Member

Choose a reason for hiding this comment

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

How should this function be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function is automatically called (from json.Unmarshal) when decoding JSON data into a Webhook instance and contains specific decoding logic.
Because the "headers" property in the returned JSON may contain an object or array and does not match the defined Go type structure.

crowdin/model/webhooks.go Outdated Show resolved Hide resolved
@andrii-bodnar andrii-bodnar merged commit 0ec2dae into main May 23, 2024
3 checks passed
@andrii-bodnar andrii-bodnar deleted the feat/webhooks-api branch May 23, 2024 08:47
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.

None yet

3 participants