diff --git a/fixture/GET/custom_ticket_status.json b/fixture/GET/custom_ticket_status.json new file mode 100644 index 00000000..a1560982 --- /dev/null +++ b/fixture/GET/custom_ticket_status.json @@ -0,0 +1,18 @@ +{ + "custom_status": { + "active": true, + "agent_label": "Responding quickly", + "created_at": "2021-07-20T22:55:29Z", + "default": false, + "description": "Customer needs a response quickly", + "end_user_description": "Your ticket is being responded to", + "end_user_label": "Urgent processing", + "id": 35436, + "raw_agent_label": "Responding quickly", + "raw_description": "Customer needs a response quickly", + "raw_end_user_description": "Your ticket is being responded to", + "raw_end_user_label": "Urgent processing", + "status_category": "open", + "updated_at": "2021-07-20T22:55:29Z" + } +} \ No newline at end of file diff --git a/fixture/GET/custom_ticket_statuses.json b/fixture/GET/custom_ticket_statuses.json new file mode 100644 index 00000000..6432be0a --- /dev/null +++ b/fixture/GET/custom_ticket_statuses.json @@ -0,0 +1,36 @@ +{ + "custom_statuses": [ + { + "active": true, + "agent_label": "Responding quickly", + "created_at": "2021-07-20T22:55:29Z", + "default": false, + "description": "Customer needs a response quickly", + "end_user_description": "Your ticket is being responded to", + "end_user_label": "Urgent processing", + "id": 35436, + "raw_agent_label": "Responding quickly", + "raw_description": "Customer needs a response quickly", + "raw_end_user_description": "Your ticket is being responded to", + "raw_end_user_label": "Urgent processing", + "status_category": "open", + "updated_at": "2021-07-20T22:55:29Z" + }, + { + "active": true, + "agent_label": "Responding quickly", + "created_at": "2021-07-20T22:55:29Z", + "default": false, + "description": "Need team action", + "end_user_description": "Your ticket is being responded to", + "end_user_label": "Low Priority", + "id": 32451, + "raw_agent_label": "Responding quickly", + "raw_description": "Need team action", + "raw_end_user_description": "Your ticket is being responded to", + "raw_end_user_label": "test processing", + "status_category": "open", + "updated_at": "2021-07-20T22:55:29Z" + } + ] +} \ No newline at end of file diff --git a/fixture/POST/custom_ticket_status.json b/fixture/POST/custom_ticket_status.json new file mode 100644 index 00000000..a1560982 --- /dev/null +++ b/fixture/POST/custom_ticket_status.json @@ -0,0 +1,18 @@ +{ + "custom_status": { + "active": true, + "agent_label": "Responding quickly", + "created_at": "2021-07-20T22:55:29Z", + "default": false, + "description": "Customer needs a response quickly", + "end_user_description": "Your ticket is being responded to", + "end_user_label": "Urgent processing", + "id": 35436, + "raw_agent_label": "Responding quickly", + "raw_description": "Customer needs a response quickly", + "raw_end_user_description": "Your ticket is being responded to", + "raw_end_user_label": "Urgent processing", + "status_category": "open", + "updated_at": "2021-07-20T22:55:29Z" + } +} \ No newline at end of file diff --git a/fixture/PUT/custom_ticket_status.json b/fixture/PUT/custom_ticket_status.json new file mode 100644 index 00000000..a1560982 --- /dev/null +++ b/fixture/PUT/custom_ticket_status.json @@ -0,0 +1,18 @@ +{ + "custom_status": { + "active": true, + "agent_label": "Responding quickly", + "created_at": "2021-07-20T22:55:29Z", + "default": false, + "description": "Customer needs a response quickly", + "end_user_description": "Your ticket is being responded to", + "end_user_label": "Urgent processing", + "id": 35436, + "raw_agent_label": "Responding quickly", + "raw_description": "Customer needs a response quickly", + "raw_end_user_description": "Your ticket is being responded to", + "raw_end_user_label": "Urgent processing", + "status_category": "open", + "updated_at": "2021-07-20T22:55:29Z" + } +} \ No newline at end of file diff --git a/go.mod b/go.mod index a91de63a..a20ddde1 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,11 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/golang/mock v1.6.0 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/mod v0.11.0 // indirect + golang.org/x/sys v0.1.0 // indirect + golang.org/x/tools v0.2.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 53c82fd5..cdd9496f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -9,9 +11,38 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/zendesk/api.go b/zendesk/api.go index 78a468e1..d0fd992e 100644 --- a/zendesk/api.go +++ b/zendesk/api.go @@ -11,6 +11,7 @@ type API interface { BaseAPI BrandAPI CustomRoleAPI + CustomTicketStatusAPI DynamicContentAPI GroupAPI GroupMembershipAPI diff --git a/zendesk/custom_ticket_status.go b/zendesk/custom_ticket_status.go new file mode 100644 index 00000000..9d3b014b --- /dev/null +++ b/zendesk/custom_ticket_status.go @@ -0,0 +1,196 @@ +package zendesk + +import ( + "context" + "encoding/json" + "fmt" + "time" +) + +type CustomTicketStatus struct { + Active bool `json:"active,omitempty"` + AgentLabel string `json:"agent_label,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Default bool `json:"default,omitempty"` + Description string `json:"description,omitempty"` + EndUserDescription string `json:"end_user_description,omitempty"` + EndUserLabel string `json:"end_user_label,omitempty"` + ID int64 `json:"id,omitempty"` + RawAgentLabel string `json:"raw_agent_label,omitempty"` + RawDescription string `json:"raw_description,omitempty"` + RawEndUserDescription string `json:"raw_end_user_description,omitempty"` + RawEndUserLabel string `json:"raw_end_user_label,omitempty"` + StatusCategory string `json:"status_category,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` +} + +type CustomTicketStatusCreateOption struct { + // If true, show only active custom ticket statuses. If false, show only inactive custom ticket statuses. If the filter is not used, show all custom ticket statuses + Active bool `json:"active,omitempty"` + + // The dynamic content placeholder or the label displayed to agents. Maximum length for displayed label is 48 characters + AgentLabel string `json:"agent_label,omitempty"` + + // The description of when the user should select this custom ticket status + Description string `json:"description,omitempty"` + + // The description displayed to end users + EndUserDescription string `json:"end_user_description,omitempty"` + + // The dynamic content placeholder or the label displayed to end users. Maximum length for displayed label is 48 characters + EndUserLabel string `json:"end_user_label,omitempty"` + + // The status category the custom status belongs to. Allowed values are "new", "open", "pending", "hold", or "solved" + StatusCategory string `json:"status_category,omitempty"` +} + +type CustomTicketStatusUpdateOption struct { + // If true, show only active custom ticket statuses. If false, show only inactive custom ticket statuses. If the filter is not used, show all custom ticket statuses + Active bool `json:"active,omitempty"` + + // The dynamic content placeholder or the label displayed to agents. Maximum length for displayed label is 48 characters + AgentLabel string `json:"agent_label,omitempty"` + + // The description of when the user should select this custom ticket status + Description string `json:"description,omitempty"` + + // The description displayed to end users + EndUserDescription string `json:"end_user_description,omitempty"` + + // The dynamic content placeholder or the label displayed to end users. Maximum length for displayed label is 48 characters + EndUserLabel string `json:"end_user_label,omitempty"` +} + +type CustomTicketStatusListOptions struct { + // If true, show only active custom ticket statuses. If false, show only inactive custom ticket statuses. If the filter is not used, show all custom ticket statuses + Active bool + + // If true, show only default custom ticket statuses. If false, show only non-default custom ticket statuses. If the filter is not used, show all custom ticket statuses + Default bool + + // Filter the list of custom ticket statuses by a comma-separated list of status categories + StatusCategories string +} + +type CustomTicketStatusListResult struct { + CustomTicketStatuses []CustomTicketStatus `json:"custom_statuses"` +} + +// CustomTicketStatusAPI an interface containing all custom ticket status related methods +type CustomTicketStatusAPI interface { + GetCustomTicketStatuses(ctx context.Context, opts *CustomTicketStatusListOptions) ([]CustomTicketStatus, error) + GetCustomTicketStatus(ctx context.Context, customTicketStatusID int64) (CustomTicketStatus, error) + CreateCustomTicketStatus(ctx context.Context, customTicketStatusCreateOptions CustomTicketStatusCreateOption) (CustomTicketStatus, error) + UpdateCustomTicketStatus(ctx context.Context, customTicketStatusID int64, customTicketStatus CustomTicketStatusUpdateOption) (CustomTicketStatus, error) +} + +// GetCustomTicketStatuses: Lists all undeleted custom ticket statuses for the account. No pagination is provided. +// +// ref: https://developer.zendesk.com/api-reference/ticketing/tickets/custom_ticket_statuses/#list-custom-ticket-statuses +func (z *Client) GetCustomTicketStatuses(ctx context.Context, opts *CustomTicketStatusListOptions) ([]CustomTicketStatus, error) { + var data struct { + CustomTicketStatuses []CustomTicketStatus `json:"custom_statuses"` + } + + tmp := opts + if tmp == nil { + tmp = &CustomTicketStatusListOptions{} + } + + u, err := addOptions("/custom_statuses.json", tmp) + if err != nil { + return nil, err + } + + body, err := z.get(ctx, u) + if err != nil { + return nil, err + } + + err = json.Unmarshal(body, &data) + if err != nil { + return nil, err + } + return data.CustomTicketStatuses, nil +} + +// GetCustomTicketStatus: Returns the custom ticket status object. +// +// ref:https://developer.zendesk.com/api-reference/ticketing/tickets/custom_ticket_statuses/#show-custom-ticket-status +func (z *Client) GetCustomTicketStatus(ctx context.Context, customTicketStatusID int64) (CustomTicketStatus, error) { + var result struct { + CustomTicketStatus CustomTicketStatus `json:"custom_status"` + } + + body, err := z.get(ctx, fmt.Sprintf("/custom_statuses/%d.json", customTicketStatusID)) + if err != nil { + return CustomTicketStatus{}, err + } + + err = json.Unmarshal(body, &result) + if err != nil { + return CustomTicketStatus{}, err + } + + return result.CustomTicketStatus, err +} + +// CreateCustomTicketStatus: Takes a CustomTicketStatusCreateOption object that specifies the custom ticket status properties to create. +// +// ref:https://developer.zendesk.com/api-reference/ticketing/tickets/custom_ticket_statuses/#create-custom-ticket-status +func (z *Client) CreateCustomTicketStatus(ctx context.Context, customTicketStatus CustomTicketStatusCreateOption) (CustomTicketStatus, error) { + var data struct { + CustomTicketStatus CustomTicketStatusCreateOption `json:"custom_status"` + } + + var result struct { + CustomTicketStatus CustomTicketStatus `json:"custom_status"` + } + + data.CustomTicketStatus = customTicketStatus + + body, err := z.Post(ctx, "/custom_statuses.json", data) + if err != nil { + return CustomTicketStatus{}, err + } + + err = json.Unmarshal(body, &result) + if err != nil { + return CustomTicketStatus{}, err + } + + return result.CustomTicketStatus, err +} + +// UpdateCustomTicketStatus: Takes a CustomTicketStatusUpdateOption object that specifies the custom ticket status properties to update. +// +// ref:https://developer.zendesk.com/api-reference/ticketing/tickets/custom_ticket_statuses/#update-custom-ticket-status +func (z *Client) UpdateCustomTicketStatus(ctx context.Context, customTicketStatusID int64, customTicketStatus CustomTicketStatusUpdateOption) (CustomTicketStatus, error) { + var data struct { + CustomTicketStatus CustomTicketStatusUpdateOption `json:"custom_status"` + } + var result struct { + CustomTicketStatus CustomTicketStatus `json:"custom_status"` + } + + data.CustomTicketStatus = customTicketStatus + + path := fmt.Sprintf("/custom_statuses/%d.json", customTicketStatusID) + + body, err := z.put(ctx, path, data) + if err != nil { + return CustomTicketStatus{}, err + } + + err = json.Unmarshal(body, &result) + if err != nil { + return CustomTicketStatus{}, err + } + + return result.CustomTicketStatus, err +} + +// Custom statuses can't be deleted at this time. +// If you deactivate a custom status, it won't be available in the status picker and agents won't be able to use it. +// You can also edit a custom status and change its name, description, etc. +// ref: https://support.zendesk.com/hc/en-us/articles/4412575941402-Managing-ticket-statuses diff --git a/zendesk/custom_ticket_status_test.go b/zendesk/custom_ticket_status_test.go new file mode 100644 index 00000000..44ad98fb --- /dev/null +++ b/zendesk/custom_ticket_status_test.go @@ -0,0 +1,56 @@ +package zendesk + +import ( + "net/http" + "testing" +) + +func TestGetCustomTicketStatuses(t *testing.T) { + mockAPI := newMockAPI(http.MethodGet, "custom_ticket_statuses.json") + client := newTestClient(mockAPI) + defer mockAPI.Close() + + items, err := client.GetCustomTicketStatuses(ctx, &CustomTicketStatusListOptions{}) + if err != nil { + t.Fatalf("Failed to get custom ticket statuses: %s", err) + } + + if len(items) != 2 { + t.Fatalf("expected length of custom ticket statuses is 2, but got %d", len(items)) + } +} + +func TestGetCustomTicketStatus(t *testing.T) { + mockAPI := newMockAPI(http.MethodGet, "custom_ticket_status.json") + client := newTestClient(mockAPI) + defer mockAPI.Close() + + item, err := client.GetCustomTicketStatus(ctx, 35436) + if err != nil { + t.Fatalf("Failed to get custom ticket status: %s", err) + } + + expectedID := int64(35436) + if item.ID != expectedID { + t.Fatalf("Returned custom ticket status id does not have the expected ID %d. Custom ticket status is %d", expectedID, item.ID) + } +} + +func TestUpdateCustomTicketStatus(t *testing.T) { + mockAPI := newMockAPI(http.MethodGet, "custom_ticket_status.json") + client := newTestClient(mockAPI) + defer mockAPI.Close() + + item, err := client.UpdateCustomTicketStatus(ctx, 35436, CustomTicketStatusUpdateOption{ + Description: "Customer needs a response quickly", + }) + if err != nil { + t.Fatalf("Failed to update custom ticket status: %s", err) + } + + expectedDesc := "Customer needs a response quickly" + if item.Description != expectedDesc { + t.Fatalf("Returned custom ticket status description not updated successfully") + } +} + diff --git a/zendesk/mock/client.go b/zendesk/mock/client.go index fe8720fb..5db214ad 100644 --- a/zendesk/mock/client.go +++ b/zendesk/mock/client.go @@ -5,6 +5,7 @@ // // mockgen -source=api.go -destination=mock/client.go -package=mock -mock_names=API=Client github.com/nukosuke/go-zendesk/zendesk API // + // Package mock is a generated GoMock package. package mock @@ -145,6 +146,21 @@ func (mr *ClientMockRecorder) CreateCustomObjectRecord(ctx, record, customObject return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCustomObjectRecord", reflect.TypeOf((*Client)(nil).CreateCustomObjectRecord), ctx, record, customObjectKey) } +// CreateCustomTicketStatus mocks base method. +func (m *Client) CreateCustomTicketStatus(ctx context.Context, customTicketStatusCreateOptions zendesk.CustomTicketStatusCreateOption) (zendesk.CustomTicketStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCustomTicketStatus", ctx, customTicketStatusCreateOptions) + ret0, _ := ret[0].(zendesk.CustomTicketStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateCustomTicketStatus indicates an expected call of CreateCustomTicketStatus. +func (mr *ClientMockRecorder) CreateCustomTicketStatus(ctx, customTicketStatusCreateOptions any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCustomTicketStatus", reflect.TypeOf((*Client)(nil).CreateCustomTicketStatus), ctx, customTicketStatusCreateOptions) +} + // CreateDynamicContentItem mocks base method. func (m *Client) CreateDynamicContentItem(ctx context.Context, item zendesk.DynamicContentItem) (zendesk.DynamicContentItem, error) { m.ctrl.T.Helper() @@ -749,18 +765,18 @@ func (mr *ClientMockRecorder) GetBrand(ctx, brandID any) *gomock.Call { } // GetCountTicketsInViews mocks base method. -func (m *Client) GetCountTicketsInViews(arg0 context.Context, arg1 []string) ([]zendesk.ViewCount, error) { +func (m *Client) GetCountTicketsInViews(ctx context.Context, ids []string) ([]zendesk.ViewCount, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCountTicketsInViews", arg0, arg1) + ret := m.ctrl.Call(m, "GetCountTicketsInViews", ctx, ids) ret0, _ := ret[0].([]zendesk.ViewCount) ret1, _ := ret[1].(error) return ret0, ret1 } // GetCountTicketsInViews indicates an expected call of GetCountTicketsInViews. -func (mr *ClientMockRecorder) GetCountTicketsInViews(arg0, arg1 interface{}) *gomock.Call { +func (mr *ClientMockRecorder) GetCountTicketsInViews(ctx, ids any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCountTicketsInViews", reflect.TypeOf((*Client)(nil).GetCountTicketsInViews), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCountTicketsInViews", reflect.TypeOf((*Client)(nil).GetCountTicketsInViews), ctx, ids) } // GetCustomRoles mocks base method. @@ -778,6 +794,36 @@ func (mr *ClientMockRecorder) GetCustomRoles(ctx any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCustomRoles", reflect.TypeOf((*Client)(nil).GetCustomRoles), ctx) } +// GetCustomTicketStatus mocks base method. +func (m *Client) GetCustomTicketStatus(ctx context.Context, customTicketStatusID int64) (zendesk.CustomTicketStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCustomTicketStatus", ctx, customTicketStatusID) + ret0, _ := ret[0].(zendesk.CustomTicketStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCustomTicketStatus indicates an expected call of GetCustomTicketStatus. +func (mr *ClientMockRecorder) GetCustomTicketStatus(ctx, customTicketStatusID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCustomTicketStatus", reflect.TypeOf((*Client)(nil).GetCustomTicketStatus), ctx, customTicketStatusID) +} + +// GetCustomTicketStatuses mocks base method. +func (m *Client) GetCustomTicketStatuses(ctx context.Context, opts *zendesk.CustomTicketStatusListOptions) ([]zendesk.CustomTicketStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCustomTicketStatuses", ctx, opts) + ret0, _ := ret[0].([]zendesk.CustomTicketStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCustomTicketStatuses indicates an expected call of GetCustomTicketStatuses. +func (mr *ClientMockRecorder) GetCustomTicketStatuses(ctx, opts any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCustomTicketStatuses", reflect.TypeOf((*Client)(nil).GetCustomTicketStatuses), ctx, opts) +} + // GetDynamicContentItem mocks base method. func (m *Client) GetDynamicContentItem(ctx context.Context, id int64) (zendesk.DynamicContentItem, error) { m.ctrl.T.Helper() @@ -2639,6 +2685,21 @@ func (mr *ClientMockRecorder) UpdateCustomObjectRecord(ctx, customObjectKey, cus return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCustomObjectRecord", reflect.TypeOf((*Client)(nil).UpdateCustomObjectRecord), ctx, customObjectKey, customObjectRecordID, record) } +// UpdateCustomTicketStatus mocks base method. +func (m *Client) UpdateCustomTicketStatus(ctx context.Context, customTicketStatusID int64, customTicketStatus zendesk.CustomTicketStatusUpdateOption) (zendesk.CustomTicketStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateCustomTicketStatus", ctx, customTicketStatusID, customTicketStatus) + ret0, _ := ret[0].(zendesk.CustomTicketStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateCustomTicketStatus indicates an expected call of UpdateCustomTicketStatus. +func (mr *ClientMockRecorder) UpdateCustomTicketStatus(ctx, customTicketStatusID, customTicketStatus any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCustomTicketStatus", reflect.TypeOf((*Client)(nil).UpdateCustomTicketStatus), ctx, customTicketStatusID, customTicketStatus) +} + // UpdateDynamicContentItem mocks base method. func (m *Client) UpdateDynamicContentItem(ctx context.Context, id int64, item zendesk.DynamicContentItem) (zendesk.DynamicContentItem, error) { m.ctrl.T.Helper()