Skip to content

Commit

Permalink
Merge 18d781e into e4e2f80
Browse files Browse the repository at this point in the history
  • Loading branch information
nukosuke committed Dec 3, 2018
2 parents e4e2f80 + 18d781e commit 2bbde86
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
11 changes: 11 additions & 0 deletions zendesk/custom_field_option.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package zendesk

// CustomFieldOption is struct for value of `custom_field_options`
type CustomFieldOption struct {
ID int64 `json:"id,omitempty"`
Name string `json:"name"`
Position int64 `json:"position,omitempty"`
RawName string `json:"raw_name,omitempty"`
URL string `json:"url,omitempty"`
Value string `json:"value"`
}
12 changes: 1 addition & 11 deletions zendesk/ticket_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ type TicketFieldSystemFieldOption struct {
Value string `json:"value"`
}

// TicketFieldCustomFieldOption is struct for value of `custom_field_options`
type TicketFieldCustomFieldOption struct {
ID int64 `json:"id,omitempty"`
Name string `json:"name"`
Position int64 `json:"position,omitempty"`
RawName string `json:"raw_name,omitempty"`
URL string `json:"url,omitempty"`
Value string `json:"value"`
}

// TicketField is struct for ticket_field payload
type TicketField struct {
ID int64 `json:"id,omitempty"`
Expand All @@ -47,7 +37,7 @@ type TicketField struct {
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
SystemFieldOptions []TicketFieldSystemFieldOption `json:"system_field_options,omitempty"`
CustomFieldOptions []TicketFieldCustomFieldOption `json:"custom_field_options,omitempty"`
CustomFieldOptions []CustomFieldOption `json:"custom_field_options,omitempty"`
SubTypeID int64 `json:"sub_type_id,omitempty"`
Removable bool `json:"removable,omitempty"`
AgentDescription string `json:"agent_description,omitempty"`
Expand Down
25 changes: 25 additions & 0 deletions zendesk/user_field.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package zendesk

import (
"time"
)

// UserField is struct for user_field payload
type UserField struct {
ID int64 `json:"id,omitempty"`
URL string `json:"url,omitempty"`
Key string `json:"key,omitempty"`
Type string `json:"type"`
Title string `json:"title"`
RawTitle string `json:"raw_title,omitempty"`
Description string `json:"description,omitempty"`
RawDescription string `json:"raw_description,omitempty"`
Position int64 `json:"position,omitempty"`
Active bool `json:"active,omitempty"`
System bool `json:"system,omitempty"`
RegexpForValidation string `json:"regexp_for_validation,omitempty"`
Tag string `json:"tag,omitempty"`
CustomFieldOptions []CustomFieldOption `json:"custom_field_options"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}

0 comments on commit 2bbde86

Please sign in to comment.