From 4f8c6b9566cd877e8fc4cc9f595d4cdfbc85e476 Mon Sep 17 00:00:00 2001 From: Andy McSherry Date: Mon, 19 Mar 2018 16:24:45 -0700 Subject: [PATCH 01/17] Ignore intellij files --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d03526f..b08b16e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,8 @@ _testmain.go *.test *.prof -/vendor \ No newline at end of file +/vendor +/.idea/modules.xml +/.idea/vcs.xml +/.idea/workspace.xml +/.idea/zendesk-go.iml From 968cfa835651e9eb01031d6075a8c17e49e781b3 Mon Sep 17 00:00:00 2001 From: Andy McSherry Date: Mon, 19 Mar 2018 16:24:57 -0700 Subject: [PATCH 02/17] Fix custom fields property on Ticket --- ticket_struct.go | 65 ++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/ticket_struct.go b/ticket_struct.go index 1d70c13..69baae6 100644 --- a/ticket_struct.go +++ b/ticket_struct.go @@ -3,34 +3,39 @@ package zendesk type Via struct{} type Ticket struct { - Id int `json:"id,omitempty"` - Url string `json:"url,omitempty"` - ExternalId string `json:"external_id,omitempty"` - Type string `json:"type,omitempty"` - Subject string `json:"subject,omitempty"` - RawSubject string `json:"raw_subject,omitempty"` - Description string `json:"description,omitempty"` - Priority string `json:"priority,omitempty"` - Status string `json:"status,omitempty"` - Recipient string `json:"recipient,omitempty"` - RequesterId int `json:"requester_id,omitempty"` - SubmitterId int `json:"submitter_id,omitempty"` - AssigneeId int `json:"assignee_id,omitempty"` - OrganizationId int `json:"organization_id,omitempty"` - GroupId int `json:"group_id,omitempty"` - CollaboratorsId []int `json:"collaborators_id,omitempty"` - ForumTopicId int `json:"forum_topic_id,omitempty"` - ProblemId int `json:"problem_id,omitempty"` - HasIncidents bool `json:"has_incidents,omitempty"` - DueAt string `json:"due_at,omitempty"` - Tags []string `json:"tags,omitempty"` - Via *Via `json:"via,omitempty"` - CustomFields []string `json:"custom_fields,omitempty"` - SatisfactionRating []string `json:"satisfaction_rating,omitempty"` - SharingAgreementIds []int `json:"sharing_agreement_ids,omitempty"` - FollowupIds []int `json:"followup_ids,omitempty"` - TicketFormId int `json:"ticket_form_id,omitempty"` - BrandId int `json:"brand_id,omitempty"` - CreatedAt string `json:"created_at,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` + Id int `json:"id,omitempty"` + Url string `json:"url,omitempty"` + ExternalId string `json:"external_id,omitempty"` + Type string `json:"type,omitempty"` + Subject string `json:"subject,omitempty"` + RawSubject string `json:"raw_subject,omitempty"` + Description string `json:"description,omitempty"` + Priority string `json:"priority,omitempty"` + Status string `json:"status,omitempty"` + Recipient string `json:"recipient,omitempty"` + RequesterId int `json:"requester_id,omitempty"` + SubmitterId int `json:"submitter_id,omitempty"` + AssigneeId int `json:"assignee_id,omitempty"` + OrganizationId int `json:"organization_id,omitempty"` + GroupId int `json:"group_id,omitempty"` + CollaboratorsId []int `json:"collaborators_id,omitempty"` + ForumTopicId int `json:"forum_topic_id,omitempty"` + ProblemId int `json:"problem_id,omitempty"` + HasIncidents bool `json:"has_incidents,omitempty"` + DueAt string `json:"due_at,omitempty"` + Tags []string `json:"tags,omitempty"` + Via *Via `json:"via,omitempty"` + CustomFields []CustomField `json:"custom_fields,omitempty"` + SatisfactionRating []string `json:"satisfaction_rating,omitempty"` + SharingAgreementIds []int `json:"sharing_agreement_ids,omitempty"` + FollowupIds []int `json:"followup_ids,omitempty"` + TicketFormId int `json:"ticket_form_id,omitempty"` + BrandId int `json:"brand_id,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` +} + +type CustomField struct { + ID int `json:"id"` + Value string `json:"value"` } From 3f1ec781cc948d07ec0b5d6b457e2cc6a3cf9bda Mon Sep 17 00:00:00 2001 From: Andy McSherry Date: Sat, 21 Jul 2018 11:20:31 -0700 Subject: [PATCH 03/17] Fix requesterId overflowing --- ticket_struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ticket_struct.go b/ticket_struct.go index 69baae6..141183d 100644 --- a/ticket_struct.go +++ b/ticket_struct.go @@ -13,7 +13,7 @@ type Ticket struct { Priority string `json:"priority,omitempty"` Status string `json:"status,omitempty"` Recipient string `json:"recipient,omitempty"` - RequesterId int `json:"requester_id,omitempty"` + RequesterId int64 `json:"requester_id,omitempty"` SubmitterId int `json:"submitter_id,omitempty"` AssigneeId int `json:"assignee_id,omitempty"` OrganizationId int `json:"organization_id,omitempty"` From 02a9d4d529eb11089af431686f54a6e26fca7019 Mon Sep 17 00:00:00 2001 From: Andy McSherry Date: Sat, 21 Jul 2018 11:24:33 -0700 Subject: [PATCH 04/17] Make userId int64 --- user_struct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_struct.go b/user_struct.go index 27a853c..1d8df13 100644 --- a/user_struct.go +++ b/user_struct.go @@ -10,7 +10,7 @@ type ManyUsers struct { } type User struct { - Id int`json:"id,omitempty"` + Id int64 `json:"id,omitempty"` Url string `json:"url,omitempty"` Name string `json:"name,omitempty"` ExternalId string `json:"external_id,omitempty"` @@ -56,4 +56,4 @@ func (users *ManyUsers) AppendUsers(user User) []User { users.Users = append(users.Users, user) return users.Users -} \ No newline at end of file +} From 417b10ee693761b3e6c44a1e9b26ceaee906e57f Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Tue, 18 Dec 2018 16:12:06 -0800 Subject: [PATCH 05/17] Update README --- README.md | 99 +++++++++++++++---------------------------------------- 1 file changed, 26 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index db51008..743cbb4 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ client, _ := zendesk.FromEnv( zendesk.LoadConfiguration("./config/configuration.yml"), ) -u, err := client.ZendeskApi().CreateOrUpdateUser(user) +u, err := client.User().CreateOrUpdate(user) if err != nil { log.Println(err) @@ -51,135 +51,88 @@ if err != nil { ## User functions available -#### GetUser +#### Get user Return the user ``` -client.ZendeskApi().GetUser(1) +client.User().GetById(1) ``` -#### GetUsers +#### Get users Return the list of all users ``` -client.ZendeskApi().GetZendeskApi() +client.User().GetAll() ``` -#### GetUsersByGroup -Return the list of all users in a group +#### Get agents +Return the list of all agents ``` -client.ZendeskApi().GetUsersByGroup(4) +client.User().GetAllAgents(4) ``` -#### CreateOrUpdateUser +#### Create or update user Create or update a user ``` -client.ZendeskApi().CreateOrUpdateUser(user) +client.User().CreateOrUpdate(user) ``` -#### CreateUser +#### Create user Create a new user ``` -client.ZendeskApi().CreateUser(user) +client.User().Create(user) ``` -#### UpdateUser +#### Update user Update an existing user ``` -client.ZendeskApi().UpdateUser(user) +client.User().Update(user) ``` -#### DeleteUser +#### Delete user Delete an existing user ``` -client.ZendeskApi().DeleteUser(1) +client.User().Delete(1) ``` ## Ticket function available -#### GetTicket +#### Get ticket Return the ticket ``` -client.ZendeskApi().GetTicket(1) +client.Ticket().GetById(1) ``` -#### GetTickets +#### Get all tickets Return the list of all tickets ``` -client.ZendeskApi().GetTickets() +client.Ticket().GetAll() ``` -#### GetRecentTickets -Return the recent tickets - -``` -client.ZendeskApi().GetRecentTickets() -``` - -#### GetTicketsFromOrganization -Return the tickets from an organization - -``` -client.ZendeskApi().GetTicketsFromOrganization(10) -``` - -#### GetManyTickets -Return a list of tickets - -``` -client.ZendeskApi().GetManyTickets(int[]{1, 2, 3, 5}) -``` - -#### GetRequestedTicketsFromUser -Return the tickets requests by an user - -``` -client.ZendeskApi().GetRequestedTicketsFromUser(2) -``` - -#### GetCcdTicketsFromUser -``` -client.ZendeskApi().GetCcdTicketsFromUser(2) -``` - -#### GetAssignedTicketsFromUser -Return the tickets assigned from user - -``` -client.ZendeskApi().GetAssignedTicketsFromUser(2) -``` - -#### CreateTicket +#### Create ticket Create a new ticket ``` -client.ZendeskApi().CreateTicket(ticket) +client.Ticket().Create(ticket) ``` -#### UpdateTicket +#### Update ticket Update a ticket ``` -client.ZendeskApi().UpdateTicket(ticket) -``` - -#### UpdateTicketMarkAsSpam -Update a ticket to mark as spam - -``` -client.ZendeskApi().UpdateTicketMarkAsSpam(1) +client.Ticket().Create(ticket) ``` -#### DeleteTicket +#### Delete ticket Delete an existing ticket ``` -client.ZendeskApi().DeleteTicket(1) +client.Ticket().Delete(1) ``` \ No newline at end of file From 30af1edbf3429fac3f5f9a0f18e5f6c09b64c673 Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Tue, 18 Dec 2018 16:13:00 -0800 Subject: [PATCH 06/17] Ignore entire .idea directory --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b08b16e..f589a79 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,4 @@ _testmain.go *.prof /vendor -/.idea/modules.xml -/.idea/vcs.xml -/.idea/workspace.xml -/.idea/zendesk-go.iml +/.idea/ From 3c6d54a44c7845ec66574e015bdb255b1a97a238 Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Tue, 18 Dec 2018 16:13:07 -0800 Subject: [PATCH 07/17] Add method to list all agents --- test/zendesk_test.go | 15 ++++++++++++--- user.go | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/test/zendesk_test.go b/test/zendesk_test.go index d3eba4b..112b407 100644 --- a/test/zendesk_test.go +++ b/test/zendesk_test.go @@ -2,7 +2,7 @@ package test import ( "testing" - "github.com/hellofresh/zendesk-go" + "zendesk-go" ) var client = zendesk.FromToken( @@ -22,7 +22,7 @@ func TestUserApiHandler_GetAll(t *testing.T) { } for _, user := range users { - id = user.Id + id = int(user.Id) break } } @@ -36,6 +36,15 @@ func TestUserApiHandler_GetById(t *testing.T) { } } +func TestUserApiHandler_GetAllAgents(t *testing.T) { + _, err := client.User().GetAllAgents() + + if err != nil { + t.Errorf("Error: %s", err) + t.Fail() + } +} + func TestUserApiHandler_Create(t *testing.T) { user := zendesk.User{ Name: "Felipe Pieretti Umpierre", @@ -96,7 +105,7 @@ func TestUserApiHandler_Delete(t *testing.T) { func TestUserApiHandler_Update(t *testing.T) { user := zendesk.User{ - Id: id, + Id: int64(id), Name: "Felipe Pieretti Umpierre - hallo", Email: "fum@hellofresh.com", } diff --git a/user.go b/user.go index cafeb53..3110c96 100644 --- a/user.go +++ b/user.go @@ -43,6 +43,20 @@ func (u UserApiHandler) GetAll() ([]User, error) { return u.parseMultiObjects(response), err } +func (u UserApiHandler) GetAllAgents() ([]User, error) { + response, err := u.client.get( + "/users.json", + map[string]string{"role[]": "admin"}, + ) + + if err != nil { + + } + + return u.parseMultiObjects(response), err +} + + func (u UserApiHandler) Create(v User) (User, error) { var object SingleUser From fcfaa43f87fc5c55490824c98210fc984bde4602 Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Wed, 19 Dec 2018 14:05:39 -0800 Subject: [PATCH 08/17] Fetch both admin & agent users --- test/zendesk_test.go | 18 +++++++++--------- user.go | 21 ++++++++++++++++++--- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/test/zendesk_test.go b/test/zendesk_test.go index 112b407..b3c57c2 100644 --- a/test/zendesk_test.go +++ b/test/zendesk_test.go @@ -7,7 +7,7 @@ import ( var client = zendesk.FromToken( zendesk.LoadConfiguration("./../config/configuration.yml"), -); +) var id int @@ -47,7 +47,7 @@ func TestUserApiHandler_GetAllAgents(t *testing.T) { func TestUserApiHandler_Create(t *testing.T) { user := zendesk.User{ - Name: "Felipe Pieretti Umpierre", + Name: "Felipe Pieretti Umpierre", Email: "fum@hellofresh.com", } @@ -61,7 +61,7 @@ func TestUserApiHandler_Create(t *testing.T) { func TestUserApiHandler_CreateOrUpdate(t *testing.T) { user := zendesk.User{ - Name: "Felipe Pieretti Umpierre = Updated", + Name: "Felipe Pieretti Umpierre = Updated", Email: "fum@hellofresh.com", } @@ -77,12 +77,12 @@ func TestUserApiHandler_CreateOrUpdateMany(t *testing.T) { var many zendesk.ManyUsers many.AppendUsers(zendesk.User{ - Name: "User 1", + Name: "User 1", Email: "user-1@hellofresh.com", }) many.AppendUsers(zendesk.User{ - Name: "User-2", + Name: "User-2", Email: "user-2@hellofresh.com", }) @@ -105,8 +105,8 @@ func TestUserApiHandler_Delete(t *testing.T) { func TestUserApiHandler_Update(t *testing.T) { user := zendesk.User{ - Id: int64(id), - Name: "Felipe Pieretti Umpierre - hallo", + Id: int64(id), + Name: "Felipe Pieretti Umpierre - hallo", Email: "fum@hellofresh.com", } @@ -180,7 +180,7 @@ func TestTicketApiHandler_Delete(t *testing.T) { func TestTicketApiHandler_Update(t *testing.T) { ticket := zendesk.Ticket{ - Id: id, + Id: id, Description: "Test ticket", } @@ -190,4 +190,4 @@ func TestTicketApiHandler_Update(t *testing.T) { t.Errorf("Error: %s", err) t.Fail() } -} \ No newline at end of file +} diff --git a/user.go b/user.go index 3110c96..a1b3bea 100644 --- a/user.go +++ b/user.go @@ -46,14 +46,29 @@ func (u UserApiHandler) GetAll() ([]User, error) { func (u UserApiHandler) GetAllAgents() ([]User, error) { response, err := u.client.get( "/users.json", - map[string]string{"role[]": "admin"}, + map[string]string{"role": "admin"}, ) if err != nil { + return nil, err + } + + users := u.parseMultiObjects(response) + + // This could be done in a single API call with role[]=agent&role[]=admin but the current interface makes doing this difficult + response, err = u.client.get( + "/users.json", + map[string]string{"role": "agent"}, + ) + if err != nil { + return nil, err } - return u.parseMultiObjects(response), err + adminUsers := u.parseMultiObjects(response) + users = append(users, adminUsers...) + + return users, err } @@ -127,4 +142,4 @@ func (u UserApiHandler) parseSingleObject(response *resty.Response) User { u.client.parseResponseToInterface(response, &object) return object.Response -} \ No newline at end of file +} From 35450b718ea4a10d9d6db4fc4f8b08cac9b3800a Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Wed, 19 Dec 2018 14:27:14 -0800 Subject: [PATCH 09/17] Add support for fetching phone numbers --- client.go | 14 +++++++++----- phone_number.go | 32 ++++++++++++++++++++++++++++++++ phone_number_struct.go | 7 +++++++ test/zendesk_test.go | 9 +++++++++ 4 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 phone_number.go create mode 100644 phone_number_struct.go diff --git a/client.go b/client.go index 426bb1c..55a31b7 100644 --- a/client.go +++ b/client.go @@ -1,14 +1,14 @@ package zendesk import ( - "gopkg.in/resty.v0" - "fmt" "encoding/json" + "fmt" + "gopkg.in/resty.v0" ) type Client struct { - domain string - client *resty.Client + domain string + client *resty.Client apiVersion string } @@ -20,6 +20,10 @@ func (c Client) Ticket() TicketApiHandler { return TicketApiHandler{c} } +func (c Client) PhoneNumber() PhoneNumberApiHandler { + return PhoneNumberApiHandler{c} +} + func (c Client) toFullUrl(path string) string { return fmt.Sprintf("https://%v.zendesk.com/api/%s/%s", c.domain, c.apiVersion, path) } @@ -60,4 +64,4 @@ func (c Client) delete(path string) (*resty.Response, error) { func (c Client) parseResponseToInterface(response *resty.Response, v interface{}) { json.Unmarshal(response.Body(), &v) -} \ No newline at end of file +} diff --git a/phone_number.go b/phone_number.go new file mode 100644 index 0000000..c4ea446 --- /dev/null +++ b/phone_number.go @@ -0,0 +1,32 @@ +package zendesk + +import "gopkg.in/resty.v0" + +type PhoneNumberApiHandler struct { + client Client +} + +type MultiplePhoneNumber struct { + Response []PhoneNumber `json:"phone_numbers"` +} + +func (p PhoneNumberApiHandler) GetAll() ([]PhoneNumber, error) { + response, err := p.client.get( + "/channels/voice/phone_numbers.json", + map[string]string{"minimal_mode": "true"}, + ) + + if err != nil { + return nil, err + } + + return p.parseMultiObjects(response), err +} + +func (p PhoneNumberApiHandler) parseMultiObjects(response *resty.Response) []PhoneNumber { + var object MultiplePhoneNumber + + p.client.parseResponseToInterface(response, &object) + + return object.Response +} diff --git a/phone_number_struct.go b/phone_number_struct.go new file mode 100644 index 0000000..eeb1d5a --- /dev/null +++ b/phone_number_struct.go @@ -0,0 +1,7 @@ +package zendesk + +type PhoneNumber struct { + Id int64 `json:"id,omitempty"` + DisplayNumber string `json:"display_number,omitempty"` + Nickname string `json:"nickname,omitempty"` +} diff --git a/test/zendesk_test.go b/test/zendesk_test.go index b3c57c2..06e8f80 100644 --- a/test/zendesk_test.go +++ b/test/zendesk_test.go @@ -191,3 +191,12 @@ func TestTicketApiHandler_Update(t *testing.T) { t.Fail() } } + +func TestPhoneNumberApiHandler_GetAll(t *testing.T) { + _, err := client.PhoneNumber().GetAll() + + if err != nil { + t.Errorf("Error: %s", err) + t.Fail() + } +} From 8e045795469ec46d505881fd0cfae65e6478903d Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Wed, 19 Dec 2018 17:34:54 -0800 Subject: [PATCH 10/17] Fix bad field type causing agents to not be returned --- user.go | 4 ++-- user_struct.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/user.go b/user.go index a1b3bea..4537fc7 100644 --- a/user.go +++ b/user.go @@ -46,7 +46,7 @@ func (u UserApiHandler) GetAll() ([]User, error) { func (u UserApiHandler) GetAllAgents() ([]User, error) { response, err := u.client.get( "/users.json", - map[string]string{"role": "admin"}, + map[string]string{"role": "agent"}, ) if err != nil { @@ -58,7 +58,7 @@ func (u UserApiHandler) GetAllAgents() ([]User, error) { // This could be done in a single API call with role[]=agent&role[]=admin but the current interface makes doing this difficult response, err = u.client.get( "/users.json", - map[string]string{"role": "agent"}, + map[string]string{"role": "admin"}, ) if err != nil { diff --git a/user_struct.go b/user_struct.go index 1d8df13..b6f2dac 100644 --- a/user_struct.go +++ b/user_struct.go @@ -32,7 +32,7 @@ type User struct { Notes string `json:"notes,omitempty"` OrganizationId int `json:"organization_id,omitempty"` Role string `json:"role,omitempty"` - CustomRoleId string `json:"custom_role_id,omitempty"` + CustomRoleId int `json:"custom_role_id,omitempty"` Moderator bool `json:"moderator,omitempty"` TicketRestriction string `json:"ticket_restriction,omitempty"` OnlyPrivateComments bool `json:"only_private_comments,omitempty"` From c18961636c64126913555f4209a6d2918c782ac0 Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Wed, 19 Dec 2018 17:35:22 -0800 Subject: [PATCH 11/17] gofmt project --- adapter.go | 2 +- builder.go | 6 ++--- global_struct.go | 2 +- ticket.go | 2 +- user.go | 1 - user_struct.go | 60 ++++++++++++++++++++++++------------------------ 6 files changed, 36 insertions(+), 37 deletions(-) diff --git a/adapter.go b/adapter.go index 7d1cab1..01bc2e0 100644 --- a/adapter.go +++ b/adapter.go @@ -14,4 +14,4 @@ type ZendeskApi interface { // Parse response parseSingleObject(response *resty.Response) interface{} parseMultiObjects(response *resty.Response) []interface{} -} \ No newline at end of file +} diff --git a/builder.go b/builder.go index 99ad46a..0b523b0 100644 --- a/builder.go +++ b/builder.go @@ -4,8 +4,8 @@ import ( "fmt" "io/ioutil" - "gopkg.in/yaml.v2" "gopkg.in/resty.v0" + "gopkg.in/yaml.v2" ) func FromToken(config ZendeskConfiguration) Client { @@ -16,9 +16,9 @@ func FromToken(config ZendeskConfiguration) Client { restyClient.SetHeader("Content-Type", "application/json") return Client{ - domain: config.Domain, + domain: config.Domain, apiVersion: config.ApiVersion, - client: restyClient, + client: restyClient, } } diff --git a/global_struct.go b/global_struct.go index e1a7e70..7801c1e 100644 --- a/global_struct.go +++ b/global_struct.go @@ -20,4 +20,4 @@ type JobStatus struct { Status string `json:"status,omitempty"` Message string `json:"mesage,omitempty"` Results string `json:"results,omitempty"` -} \ No newline at end of file +} diff --git a/ticket.go b/ticket.go index dcf4a5a..24a17a4 100644 --- a/ticket.go +++ b/ticket.go @@ -97,4 +97,4 @@ func (t TicketApiHandler) parseSingleObject(response *resty.Response) Ticket { t.client.parseResponseToInterface(response, &object) return object.Response -} \ No newline at end of file +} diff --git a/user.go b/user.go index 4537fc7..f4e73f3 100644 --- a/user.go +++ b/user.go @@ -71,7 +71,6 @@ func (u UserApiHandler) GetAllAgents() ([]User, error) { return users, err } - func (u UserApiHandler) Create(v User) (User, error) { var object SingleUser diff --git a/user_struct.go b/user_struct.go index b6f2dac..a124c09 100644 --- a/user_struct.go +++ b/user_struct.go @@ -10,36 +10,36 @@ type ManyUsers struct { } type User struct { - Id int64 `json:"id,omitempty"` - Url string `json:"url,omitempty"` - Name string `json:"name,omitempty"` - ExternalId string `json:"external_id,omitempty"` - Alias string `json:"alias,omitempty"` - CreatedAt string `json:"created_at,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` - Active bool `json:"active,omitempty"` - Verified bool `json:"verified,omitempty"` - Shared bool `json:"shared,omitempty"` - SharedAgent bool `json:"shared_agent,omitempty"` - Locale string `json:"locale,omitempty"` - LocaleId int `json:"locale_id,omitempty"` - TimeZone string `json:"time_zone,omitempty"` - LastLoginAt string `json:"last_login_at,omitempty"` - Email string `json:"email,omitempty"` - Phone string `json:"phone,omitempty"` - Signature string `json:"signature,omitempty"` - Details string `json:"details,omitempty"` - Notes string `json:"notes,omitempty"` - OrganizationId int `json:"organization_id,omitempty"` - Role string `json:"role,omitempty"` - CustomRoleId int `json:"custom_role_id,omitempty"` - Moderator bool `json:"moderator,omitempty"` - TicketRestriction string `json:"ticket_restriction,omitempty"` - OnlyPrivateComments bool `json:"only_private_comments,omitempty"` - Tags []string `json:"tags,omitempty"` - Suspended bool `json:"suspended,omitempty"` - RestrictedAgent bool `json:"restricted_agent,omitempty"` - Photo *Attachment `json:"photo,omitempty"` + Id int64 `json:"id,omitempty"` + Url string `json:"url,omitempty"` + Name string `json:"name,omitempty"` + ExternalId string `json:"external_id,omitempty"` + Alias string `json:"alias,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + Active bool `json:"active,omitempty"` + Verified bool `json:"verified,omitempty"` + Shared bool `json:"shared,omitempty"` + SharedAgent bool `json:"shared_agent,omitempty"` + Locale string `json:"locale,omitempty"` + LocaleId int `json:"locale_id,omitempty"` + TimeZone string `json:"time_zone,omitempty"` + LastLoginAt string `json:"last_login_at,omitempty"` + Email string `json:"email,omitempty"` + Phone string `json:"phone,omitempty"` + Signature string `json:"signature,omitempty"` + Details string `json:"details,omitempty"` + Notes string `json:"notes,omitempty"` + OrganizationId int `json:"organization_id,omitempty"` + Role string `json:"role,omitempty"` + CustomRoleId int `json:"custom_role_id,omitempty"` + Moderator bool `json:"moderator,omitempty"` + TicketRestriction string `json:"ticket_restriction,omitempty"` + OnlyPrivateComments bool `json:"only_private_comments,omitempty"` + Tags []string `json:"tags,omitempty"` + Suspended bool `json:"suspended,omitempty"` + RestrictedAgent bool `json:"restricted_agent,omitempty"` + Photo *Attachment `json:"photo,omitempty"` UserFields map[string]interface{} `json:"user_fields,omitempty"` } From 234d040c668a098a8815c9d1135cafc16833c599 Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Fri, 28 Dec 2018 15:56:24 -0800 Subject: [PATCH 12/17] Update type of CustomField.value since it isn't always a string --- ticket_struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ticket_struct.go b/ticket_struct.go index 141183d..674c910 100644 --- a/ticket_struct.go +++ b/ticket_struct.go @@ -37,5 +37,5 @@ type Ticket struct { type CustomField struct { ID int `json:"id"` - Value string `json:"value"` + Value interface{} `json:"value"` } From 91599c669e5fd7569382c6e5aad21b9eaedfe9f4 Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Wed, 2 Jan 2019 14:15:40 -0800 Subject: [PATCH 13/17] Add support for merging users --- test/zendesk_test.go | 24 ++++++++++++++++++++++++ user.go | 13 +++++++++++++ 2 files changed, 37 insertions(+) diff --git a/test/zendesk_test.go b/test/zendesk_test.go index 06e8f80..e6c5080 100644 --- a/test/zendesk_test.go +++ b/test/zendesk_test.go @@ -1,7 +1,9 @@ package test import ( + "fmt" "testing" + "time" "zendesk-go" ) @@ -103,6 +105,28 @@ func TestUserApiHandler_Delete(t *testing.T) { } } +func TestUserApiHandler_Merge(t *testing.T) { + user := zendesk.User{ + Name: "User 1", + Email: fmt.Sprintf("test-%d@hellofresh.com", time.Now().Unix()), + } + newUser, err := client.User().CreateOrUpdate(user) + + user2 := zendesk.User{ + Name: "User 2", + Phone: "(415) 123-4567", + } + + userToKeep, err := client.User().CreateOrUpdate(user2) + + _, err = client.User().Merge(int(newUser.Id), userToKeep) + + if err != nil { + t.Errorf("Error: %s", err) + t.Fail() + } +} + func TestUserApiHandler_Update(t *testing.T) { user := zendesk.User{ Id: int64(id), diff --git a/user.go b/user.go index f4e73f3..899f64b 100644 --- a/user.go +++ b/user.go @@ -127,6 +127,19 @@ func (u UserApiHandler) Delete(id int) (int, error) { return response.StatusCode(), err } + +func (u UserApiHandler) Merge(userIdToMerge int, userToKeep User) (User, error) { + var object SingleUser + + _, err := u.client.put( + fmt.Sprintf("/users/%d/merge.json", userIdToMerge), + map[string]User{"user": userToKeep}, + &object, + ) + + return object.Response, err +} + func (u UserApiHandler) parseMultiObjects(response *resty.Response) []User { var object MultipleUser From c507528a442c72a65e0901e0139637bd8abee1a4 Mon Sep 17 00:00:00 2001 From: Jean Yang Date: Tue, 8 Jan 2019 16:28:01 -0800 Subject: [PATCH 14/17] Add support for fetching tickets requested by user and fetching comments for ticket --- client.go | 4 ++++ comment.go | 35 +++++++++++++++++++++++++++++++++++ comment_struct.go | 7 +++++++ test/zendesk_test.go | 18 ++++++++++++++++++ ticket.go | 13 ++++++++++++- ticket_struct.go | 2 +- user.go | 1 - 7 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 comment.go create mode 100644 comment_struct.go diff --git a/client.go b/client.go index 55a31b7..ef8dc63 100644 --- a/client.go +++ b/client.go @@ -24,6 +24,10 @@ func (c Client) PhoneNumber() PhoneNumberApiHandler { return PhoneNumberApiHandler{c} } +func (c Client) Comment() CommentApiHandler { + return CommentApiHandler{c} +} + func (c Client) toFullUrl(path string) string { return fmt.Sprintf("https://%v.zendesk.com/api/%s/%s", c.domain, c.apiVersion, path) } diff --git a/comment.go b/comment.go new file mode 100644 index 0000000..33f763a --- /dev/null +++ b/comment.go @@ -0,0 +1,35 @@ +package zendesk + +import ( + "fmt" + "gopkg.in/resty.v0" +) + +type CommentApiHandler struct { + client Client +} + +type MultipleComment struct { + Response []Comment `json:"comments"` +} + +func (c CommentApiHandler) GetForTicket(ticketId int) ([]Comment, error) { + response, err := c.client.get( + fmt.Sprintf("/tickets/%d/comments.json", ticketId), + nil, + ) + + if err != nil { + return nil, err + } + + return c.parseMultiObjects(response), err +} + +func (c CommentApiHandler) parseMultiObjects(response *resty.Response) []Comment { + var object MultipleComment + + c.client.parseResponseToInterface(response, &object) + + return object.Response +} diff --git a/comment_struct.go b/comment_struct.go new file mode 100644 index 0000000..a180751 --- /dev/null +++ b/comment_struct.go @@ -0,0 +1,7 @@ +package zendesk + +type Comment struct { + Id int64 `json:"id,omitempty"` + AuthorId int64 `json:"author_id,omitempty"` + CreatedAt string `json:"created_at,omitempty"` +} diff --git a/test/zendesk_test.go b/test/zendesk_test.go index e6c5080..7481dd7 100644 --- a/test/zendesk_test.go +++ b/test/zendesk_test.go @@ -216,6 +216,24 @@ func TestTicketApiHandler_Update(t *testing.T) { } } +func TestTicketApiHandler_GetRequestedByUser(t *testing.T) { + _, err := client.Ticket().GetRequestedByUser(0) + + if err != nil { + t.Errorf("Error: %s", err) + t.Fail() + } +} + +func TestCommentApiHandler_GetForTicket(t *testing.T) { + _, err := client.Comment().GetForTicket(0) + + if err != nil { + t.Errorf("Error: %s", err) + t.Fail() + } +} + func TestPhoneNumberApiHandler_GetAll(t *testing.T) { _, err := client.PhoneNumber().GetAll() diff --git a/ticket.go b/ticket.go index 24a17a4..f5e5825 100644 --- a/ticket.go +++ b/ticket.go @@ -24,7 +24,6 @@ func (t TicketApiHandler) GetById(id int) (Ticket, error) { ) if err != nil { - } return t.parseSingleObject(response), err @@ -37,7 +36,19 @@ func (t TicketApiHandler) GetAll() ([]Ticket, error) { ) if err != nil { + } + + return t.parseMultiObjects(response), err +} +func (t TicketApiHandler) GetRequestedByUser(userId int64) ([]Ticket, error) { + response, err := t.client.get( + fmt.Sprintf("/users/%d/tickets/requested.json", userId), + nil, + ) + + if err != nil { + return nil, err } return t.parseMultiObjects(response), err diff --git a/ticket_struct.go b/ticket_struct.go index 674c910..92c233c 100644 --- a/ticket_struct.go +++ b/ticket_struct.go @@ -36,6 +36,6 @@ type Ticket struct { } type CustomField struct { - ID int `json:"id"` + ID int `json:"id"` Value interface{} `json:"value"` } diff --git a/user.go b/user.go index 899f64b..b0435c2 100644 --- a/user.go +++ b/user.go @@ -127,7 +127,6 @@ func (u UserApiHandler) Delete(id int) (int, error) { return response.StatusCode(), err } - func (u UserApiHandler) Merge(userIdToMerge int, userToKeep User) (User, error) { var object SingleUser From db369a23bc8dad3a267c348c7ac936e10eadf9f5 Mon Sep 17 00:00:00 2001 From: Jinsu Mathew Date: Tue, 12 Oct 2021 13:46:59 -0700 Subject: [PATCH 15/17] Removes unused field satisfaction_rating from Ticket, causing parsing issues --- ticket_struct.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ticket_struct.go b/ticket_struct.go index 92c233c..69295f5 100644 --- a/ticket_struct.go +++ b/ticket_struct.go @@ -26,7 +26,6 @@ type Ticket struct { Tags []string `json:"tags,omitempty"` Via *Via `json:"via,omitempty"` CustomFields []CustomField `json:"custom_fields,omitempty"` - SatisfactionRating []string `json:"satisfaction_rating,omitempty"` SharingAgreementIds []int `json:"sharing_agreement_ids,omitempty"` FollowupIds []int `json:"followup_ids,omitempty"` TicketFormId int `json:"ticket_form_id,omitempty"` From 3e69d4ec4ae058ac3ccf9fcbdb45adc37893cdb6 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 4 Apr 2022 15:37:08 -0700 Subject: [PATCH 16/17] Update resty and move to go modules --- Godeps/Godeps.json | 32 -------------------------------- Godeps/Readme | 5 ----- adapter.go | 2 +- builder.go | 8 ++++---- client.go | 2 +- comment.go | 2 +- go.mod | 17 +++++++++++++++++ go.sum | 31 +++++++++++++++++++++++++++++++ phone_number.go | 2 +- ticket.go | 2 +- user.go | 2 +- 11 files changed, 58 insertions(+), 47 deletions(-) delete mode 100644 Godeps/Godeps.json delete mode 100644 Godeps/Readme create mode 100644 go.mod create mode 100644 go.sum diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json deleted file mode 100644 index e61f415..0000000 --- a/Godeps/Godeps.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "ImportPath": "github.com/hellofresh/zendesk-go", - "GoVersion": "go1.6", - "GodepVersion": "v60", - "Deps": [ - { - "ImportPath": "github.com/golang/protobuf/proto", - "Rev": "f0a097ddac24fb00e07d2ac17f8671423f3ea47c" - }, - { - "ImportPath": "github.com/ttacon/builder", - "Rev": "7f152c3cf4714fd6318739f8f3dbcd14c2a18b39" - }, - { - "ImportPath": "github.com/ttacon/libphonenumber", - "Rev": "1197dfb91fa03c779576ad248ad5ca0a43fb3a31" - }, - { - "ImportPath": "golang.org/x/net/publicsuffix", - "Rev": "4876518f9e71663000c348837735820161a42df7" - }, - { - "ImportPath": "gopkg.in/resty.v0", - "Comment": "v0.6", - "Rev": "aed15a666de54595af7d8895aa7299ceff5635f8" - }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "a83829b6f1293c91addabc89d0571c246397bbf4" - } - ] -} diff --git a/Godeps/Readme b/Godeps/Readme deleted file mode 100644 index 4cdaa53..0000000 --- a/Godeps/Readme +++ /dev/null @@ -1,5 +0,0 @@ -This directory tree is generated automatically by godep. - -Please do not edit. - -See https://github.com/tools/godep for more information. diff --git a/adapter.go b/adapter.go index 01bc2e0..eb38c86 100644 --- a/adapter.go +++ b/adapter.go @@ -1,6 +1,6 @@ package zendesk -import "gopkg.in/resty.v0" +import "github.com/go-resty/resty/v2" type ZendeskApi interface { GetById(id int) (interface{}, error) diff --git a/builder.go b/builder.go index 0b523b0..2ed5ba6 100644 --- a/builder.go +++ b/builder.go @@ -2,16 +2,16 @@ package zendesk import ( "fmt" - "io/ioutil" - - "gopkg.in/resty.v0" + "github.com/go-resty/resty/v2" "gopkg.in/yaml.v2" + "io/ioutil" ) func FromToken(config ZendeskConfiguration) Client { username := fmt.Sprintf("%s/token", config.Email) - restyClient := resty.SetBasicAuth(username, config.Token) + restyClient := resty.New() + restyClient.SetBasicAuth(username, config.Token) restyClient.SetHeader("Accept", "application/json") restyClient.SetHeader("Content-Type", "application/json") diff --git a/client.go b/client.go index ef8dc63..6b58c5e 100644 --- a/client.go +++ b/client.go @@ -3,7 +3,7 @@ package zendesk import ( "encoding/json" "fmt" - "gopkg.in/resty.v0" + "github.com/go-resty/resty/v2" ) type Client struct { diff --git a/comment.go b/comment.go index 33f763a..e8636c3 100644 --- a/comment.go +++ b/comment.go @@ -2,7 +2,7 @@ package zendesk import ( "fmt" - "gopkg.in/resty.v0" + "github.com/go-resty/resty/v2" ) type CommentApiHandler struct { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..d8dd77b --- /dev/null +++ b/go.mod @@ -0,0 +1,17 @@ +module zendesk-go + +go 1.18 + +require ( + github.com/ttacon/libphonenumber v1.2.1 + github.com/go-resty/resty/v2 v2.7.0 + gopkg.in/yaml.v2 v2.4.0 +) + +require ( + github.com/go-resty/resty/v2 v2.7.0 + github.com/golang/protobuf v1.5.2 // indirect + github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 // indirect + golang.org/x/net v0.0.0-20211029224645-99673261e6eb // indirect + google.golang.org/protobuf v1.26.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..572c24b --- /dev/null +++ b/go.sum @@ -0,0 +1,31 @@ +github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= +github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 h1:5u+EJUQiosu3JFX0XS0qTf5FznsMOzTjGqavBGuCbo0= +github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2/go.mod h1:4kyMkleCiLkgY6z8gK5BkI01ChBtxR0ro3I1ZDcGM3w= +github.com/ttacon/libphonenumber v1.2.1 h1:fzOfY5zUADkCkbIafAed11gL1sW+bJ26p6zWLBMElR4= +github.com/ttacon/libphonenumber v1.2.1/go.mod h1:E0TpmdVMq5dyVlQ7oenAkhsLu86OkUl+yR4OAxyEg/M= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb h1:pirldcYWx7rx7kE5r+9WsOXPXK0+WH5+uZ7uPmJ44uM= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/phone_number.go b/phone_number.go index c4ea446..1cdf812 100644 --- a/phone_number.go +++ b/phone_number.go @@ -1,6 +1,6 @@ package zendesk -import "gopkg.in/resty.v0" +import "github.com/go-resty/resty/v2" type PhoneNumberApiHandler struct { client Client diff --git a/ticket.go b/ticket.go index f5e5825..ed5cf19 100644 --- a/ticket.go +++ b/ticket.go @@ -2,7 +2,7 @@ package zendesk import ( "fmt" - "gopkg.in/resty.v0" + "github.com/go-resty/resty/v2" ) type TicketApiHandler struct { diff --git a/user.go b/user.go index b0435c2..a9d5436 100644 --- a/user.go +++ b/user.go @@ -2,7 +2,7 @@ package zendesk import ( "fmt" - "gopkg.in/resty.v0" + "github.com/go-resty/resty/v2" ) type UserApiHandler struct { From 15589642ab3d56ca657c45108a4cbd1cafc394ee Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 4 Apr 2022 16:37:55 -0700 Subject: [PATCH 17/17] Update go-module name --- go.mod | 4 ++-- go.sum | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index d8dd77b..c2aa826 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ -module zendesk-go +module github.com/gomaps/zendesk-go go 1.18 require ( - github.com/ttacon/libphonenumber v1.2.1 github.com/go-resty/resty/v2 v2.7.0 + github.com/ttacon/libphonenumber v1.2.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 572c24b..88ee664 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,6 @@ github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 h1:5u+EJUQiosu3JFX0 github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2/go.mod h1:4kyMkleCiLkgY6z8gK5BkI01ChBtxR0ro3I1ZDcGM3w= github.com/ttacon/libphonenumber v1.2.1 h1:fzOfY5zUADkCkbIafAed11gL1sW+bJ26p6zWLBMElR4= github.com/ttacon/libphonenumber v1.2.1/go.mod h1:E0TpmdVMq5dyVlQ7oenAkhsLu86OkUl+yR4OAxyEg/M= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20211029224645-99673261e6eb h1:pirldcYWx7rx7kE5r+9WsOXPXK0+WH5+uZ7uPmJ44uM= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -25,7 +23,5 @@ google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/l google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=