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

Add Support for UserFields in ZendeskApi_v2 #599

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ruannbotes
Copy link

Summary:
This pull request adds support for managing UserFields within the ZendeskApi_v2 package. It includes both synchronous and asynchronous methods for CRUD operations on UserFields. The implementation aligns with the existing structure for managing TicketFields, ensuring consistency and ease of use.

Changes Include:

API Methods: Implemented sync and async methods for UserFields operations.
Models: Added UserField, GroupUserFieldResponse, and IndividualUserFieldResponse models to represent UserFields and responses.
Constants: Introduced UserFieldTypes constants for standardized handling of field types.
Requests Update: Extended Users requests to support the new UserFields functionality.
Unit Tests: Updated UsersTests to cover the new UserField methods, including both sync and async operations.
Testing:

Added comprehensive unit tests to ensure proper functionality for all new methods.
Tests include validation of input and output for the UserFields operations, ensuring they work as expected.

- Introduced constants for UserFieldTypes to ensure consistent usage across the codebase.
- Created models: GroupUserFieldResponse, IndividualUserFieldResponse, UserField.
- These models handle the structure of data returned by UserField endpoints.
- Implemented sync and async methods to handle UserField endpoints.
- Added tests for sync and async UserField API methods.
- Updated UsersTests to cover new UserField scenarios.
…nterface methods

Corrected the parameter names in the async interface methods where ticketField was mistakenly used instead of userField.
@CLAassistant
Copy link

CLAassistant commented Aug 20, 2024

CLA assistant check
All committers have signed the CLA.

@ruannbotes
Copy link
Author

Hi @mozts2005,

I can address the issues flagged by CodeFactor. However, the test failures in the pipeline seem to be related to invalid or expired secrets. The pipeline output shows the following error:

jsonException: {"error":"Couldn't authenticate you"}
2024-08-20T11:47:02.1169102Z ----> System.Net.WebException : The remote server returned an error: (401) Unauthorized.

It looks like the authentication details may need to be updated. Could you confirm if the secrets used in the pipeline are still valid?

Thanks!

@mozts2005
Copy link
Member

Yes, I will update the pipeline secret and rerun the test.

- Separated UserField classes into individual files.
- Consolidated fields into a unified UserField class.
- Moved CustomFieldOption to a shared folder for reuse.
- Updated UserTests.cs to reflect structural changes.
-An opening brace should not be followed by a blank line. (SA1505)
@ruannbotes
Copy link
Author

Hi @mozts2005,

I have resolved the CodeFactor issues, tests still failing due to authentication which I believe will be resolved with your secret update.

Thanks!

@ruannbotes
Copy link
Author

Hi @mozts2005

Hope you doing well, just following on the pull request and pipeline secrets issue.

Thanks.

@MelGrubb
Copy link
Contributor

Is there any movement on this? Or maybe a fork somewhere that has this already? I am stuck needing to update a user field and there's no support in the current version of the API. I either have to fork my own and add it myself following this PR, or I'm going to have to go raw http-request.

I'd really rather not
a) Take on responsibility for yet another library
OR
b) Introduce another inconsistency by using a library for "all but one" call that I need to make to Zendesk.

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.

4 participants