1/**
2 * Copyright 2016 IBM Corp.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *    http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * AUTOMATICALLY GENERATED CODE - DO NOT MODIFY
19 */
20
21package services
22
23import (
24	"fmt"
25	"strings"
26
27	"github.com/softlayer/softlayer-go/datatypes"
28	"github.com/softlayer/softlayer-go/session"
29	"github.com/softlayer/softlayer-go/sl"
30)
31
32// The SoftLayer_Ticket data type models a single SoftLayer customer support or notification ticket. Each ticket object contains references to it's updates, the user it's assigned to, the SoftLayer department and employee that it's assigned to, and any hardware objects or attached files associated with the ticket. Tickets are described in further detail on the [[SoftLayer_Ticket]] service page.
33//
34// To create a support ticket execute the [[SoftLayer_Ticket::createStandardTicket|createStandardTicket]] or [[SoftLayer_Ticket::createAdministrativeTicket|createAdministrativeTicket]] methods in the SoftLayer_Ticket service. To create an upgrade ticket for the SoftLayer sales group execute the [[SoftLayer_Ticket::createUpgradeTicket|createUpgradeTicket]].
35type Ticket struct {
36	Session *session.Session
37	Options sl.Options
38}
39
40// GetTicketService returns an instance of the Ticket SoftLayer service
41func GetTicketService(sess *session.Session) Ticket {
42	return Ticket{Session: sess}
43}
44
45func (r Ticket) Id(id int) Ticket {
46	r.Options.Id = &id
47	return r
48}
49
50func (r Ticket) Mask(mask string) Ticket {
51	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
52		mask = fmt.Sprintf("mask[%s]", mask)
53	}
54
55	r.Options.Mask = mask
56	return r
57}
58
59func (r Ticket) Filter(filter string) Ticket {
60	r.Options.Filter = filter
61	return r
62}
63
64func (r Ticket) Limit(limit int) Ticket {
65	r.Options.Limit = &limit
66	return r
67}
68
69func (r Ticket) Offset(offset int) Ticket {
70	r.Options.Offset = &offset
71	return r
72}
73
74//
75//
76//
77func (r Ticket) AddAssignedAgent(agentId *int) (err error) {
78	var resp datatypes.Void
79	params := []interface{}{
80		agentId,
81	}
82	err = r.Session.DoRequest("SoftLayer_Ticket", "addAssignedAgent", params, &r.Options, &resp)
83	return
84}
85
86// Creates new additional emails for assigned user if new emails are provided. Attaches any newly created additional emails to ticket.
87func (r Ticket) AddAttachedAdditionalEmails(emails []string) (resp bool, err error) {
88	params := []interface{}{
89		emails,
90	}
91	err = r.Session.DoRequest("SoftLayer_Ticket", "addAttachedAdditionalEmails", params, &r.Options, &resp)
92	return
93}
94
95// Attach the given Dedicated Host to a SoftLayer ticket. An attachment provides an easy way for SoftLayer's employees to quickly look up your records in the case of specific issues.
96func (r Ticket) AddAttachedDedicatedHost(dedicatedHostId *int) (resp datatypes.Ticket_Attachment_Dedicated_Host, err error) {
97	params := []interface{}{
98		dedicatedHostId,
99	}
100	err = r.Session.DoRequest("SoftLayer_Ticket", "addAttachedDedicatedHost", params, &r.Options, &resp)
101	return
102}
103
104// Attach the given file to a SoftLayer ticket. A file attachment is a convenient way to submit non-textual error reports to SoftLayer employees in a ticket. File attachments to tickets must have a unique name.
105func (r Ticket) AddAttachedFile(fileAttachment *datatypes.Container_Utility_File_Attachment) (resp datatypes.Ticket_Attachment_File, err error) {
106	params := []interface{}{
107		fileAttachment,
108	}
109	err = r.Session.DoRequest("SoftLayer_Ticket", "addAttachedFile", params, &r.Options, &resp)
110	return
111}
112
113// Attach the given hardware to a SoftLayer ticket. A hardware attachment provides an easy way for SoftLayer's employees to quickly look up your hardware records in the case of hardware-specific issues.
114func (r Ticket) AddAttachedHardware(hardwareId *int) (resp datatypes.Ticket_Attachment_Hardware, err error) {
115	params := []interface{}{
116		hardwareId,
117	}
118	err = r.Session.DoRequest("SoftLayer_Ticket", "addAttachedHardware", params, &r.Options, &resp)
119	return
120}
121
122// Attach the given CloudLayer Computing Instance to a SoftLayer ticket. An attachment provides an easy way for SoftLayer's employees to quickly look up your records in the case of specific issues.
123func (r Ticket) AddAttachedVirtualGuest(guestId *int, callCommit *bool) (resp datatypes.Ticket_Attachment_Virtual_Guest, err error) {
124	params := []interface{}{
125		guestId,
126		callCommit,
127	}
128	err = r.Session.DoRequest("SoftLayer_Ticket", "addAttachedVirtualGuest", params, &r.Options, &resp)
129	return
130}
131
132// As part of the customer service process SoftLayer has provided a quick feedback mechanism for its customers to rate their overall experience with SoftLayer after a ticket is closed. addFinalComments() sets these comments for a ticket update made by a SoftLayer employee. Final comments may only be set on closed tickets, can only be set once, and may not exceed 4000 characters in length. Once the comments are set ''addFinalComments()'' returns a boolean true.
133func (r Ticket) AddFinalComments(finalComments *string) (resp bool, err error) {
134	params := []interface{}{
135		finalComments,
136	}
137	err = r.Session.DoRequest("SoftLayer_Ticket", "addFinalComments", params, &r.Options, &resp)
138	return
139}
140
141// no documentation yet
142func (r Ticket) AddScheduledAlert(activationTime *string) (err error) {
143	var resp datatypes.Void
144	params := []interface{}{
145		activationTime,
146	}
147	err = r.Session.DoRequest("SoftLayer_Ticket", "addScheduledAlert", params, &r.Options, &resp)
148	return
149}
150
151// no documentation yet
152func (r Ticket) AddScheduledAutoClose(activationTime *string) (err error) {
153	var resp datatypes.Void
154	params := []interface{}{
155		activationTime,
156	}
157	err = r.Session.DoRequest("SoftLayer_Ticket", "addScheduledAutoClose", params, &r.Options, &resp)
158	return
159}
160
161// Add an update to a ticket. A ticket update's entry has a maximum length of 4000 characters, so ''addUpdate()'' splits the ''entry'' property in the ''templateObject'' parameter into 3900 character blocks and creates one entry per 3900 character block. Once complete ''addUpdate()'' emails the ticket's owner and additional email addresses with an update message if the ticket's ''notifyUserOnUpdateFlag'' is set. If the ticket is a Legal or Abuse ticket, then the account's abuse emails are also notified when the updates are processed. Finally, ''addUpdate()'' returns an array of the newly created ticket updates.
162func (r Ticket) AddUpdate(templateObject *datatypes.Ticket_Update, attachedFiles []datatypes.Container_Utility_File_Attachment) (resp []datatypes.Ticket_Update, err error) {
163	params := []interface{}{
164		templateObject,
165		attachedFiles,
166	}
167	err = r.Session.DoRequest("SoftLayer_Ticket", "addUpdate", params, &r.Options, &resp)
168	return
169}
170
171// Create an administrative support ticket. Use an administrative ticket if you require SoftLayer's assistance managing your server or content. If you are experiencing an issue with SoftLayer's hardware, network, or services then please open a standard support ticket.
172//
173// Support tickets may only be created in the open state. The SoftLayer API defaults new ticket properties ''userEditableFlag'' to true, ''accountId'' to the id of the account that your API user belongs to, and ''statusId'' to 1001 (or "open"). You may not assign your new to ticket to users that your API user does not have access to.
174//
175// Once your ticket is created it is placed in a queue for SoftLayer employees to work. As they update the ticket new [[SoftLayer_Ticket_Update]] entries are added to the ticket object.
176//
177// Administrative support tickets add a one-time $3USD charge to your account.
178func (r Ticket) CreateAdministrativeTicket(templateObject *datatypes.Ticket, contents *string, attachmentId *int, rootPassword *string, controlPanelPassword *string, accessPort *string, attachedFiles []datatypes.Container_Utility_File_Attachment, attachmentType *string) (resp datatypes.Ticket, err error) {
179	params := []interface{}{
180		templateObject,
181		contents,
182		attachmentId,
183		rootPassword,
184		controlPanelPassword,
185		accessPort,
186		attachedFiles,
187		attachmentType,
188	}
189	err = r.Session.DoRequest("SoftLayer_Ticket", "createAdministrativeTicket", params, &r.Options, &resp)
190	return
191}
192
193// A cancel server request creates a ticket to cancel the resource on next bill date. The hardware ID parameter is required to determine which server is to be cancelled. NOTE: Hourly bare metal servers will be cancelled on next bill date.
194//
195// The reason parameter could be from the list below:
196// * "No longer needed"
197// * "Business closing down"
198// * "Server / Upgrade Costs"
199// * "Migrating to larger server"
200// * "Migrating to smaller server"
201// * "Migrating to a different SoftLayer datacenter"
202// * "Network performance / latency"
203// * "Support response / timing"
204// * "Sales process / upgrades"
205// * "Moving to competitor"
206//
207//
208// The content parameter describes further the reason for cancelling the server.
209func (r Ticket) CreateCancelServerTicket(attachmentId *int, reason *string, content *string, cancelAssociatedItems *bool, attachmentType *string) (resp datatypes.Ticket, err error) {
210	params := []interface{}{
211		attachmentId,
212		reason,
213		content,
214		cancelAssociatedItems,
215		attachmentType,
216	}
217	err = r.Session.DoRequest("SoftLayer_Ticket", "createCancelServerTicket", params, &r.Options, &resp)
218	return
219}
220
221// A cancel service request creates a sales ticket. The hardware ID parameter is required to determine which server is to be cancelled.
222//
223// The reason parameter could be from the list below:
224// * "No longer needed"
225// * "Business closing down"
226// * "Server / Upgrade Costs"
227// * "Migrating to larger server"
228// * "Migrating to smaller server"
229// * "Migrating to a different SoftLayer datacenter"
230// * "Network performance / latency"
231// * "Support response / timing"
232// * "Sales process / upgrades"
233// * "Moving to competitor"
234//
235//
236// The content parameter describes further the reason for cancelling service.
237func (r Ticket) CreateCancelServiceTicket(attachmentId *int, reason *string, content *string, attachmentType *string) (resp datatypes.Ticket, err error) {
238	params := []interface{}{
239		attachmentId,
240		reason,
241		content,
242		attachmentType,
243	}
244	err = r.Session.DoRequest("SoftLayer_Ticket", "createCancelServiceTicket", params, &r.Options, &resp)
245	return
246}
247
248// Create a standard support ticket. Use a standard support ticket if you need to work out a problem related to SoftLayer's hardware, network, or services. If you require SoftLayer's assistance managing your server or content then please open an administrative ticket.
249//
250// Support tickets may only be created in the open state. The SoftLayer API defaults new ticket properties ''userEditableFlag'' to true, ''accountId'' to the id of the account that your API user belongs to, and ''statusId'' to 1001 (or "open"). You may not assign your new to ticket to users that your API user does not have access to.
251//
252// Once your ticket is created it is placed in a queue for SoftLayer employees to work. As they update the ticket new [[SoftLayer_Ticket_Update]] entries are added to the ticket object.
253func (r Ticket) CreateStandardTicket(templateObject *datatypes.Ticket, contents *string, attachmentId *int, rootPassword *string, controlPanelPassword *string, accessPort *string, attachedFiles []datatypes.Container_Utility_File_Attachment, attachmentType *string) (resp datatypes.Ticket, err error) {
254	params := []interface{}{
255		templateObject,
256		contents,
257		attachmentId,
258		rootPassword,
259		controlPanelPassword,
260		accessPort,
261		attachedFiles,
262		attachmentType,
263	}
264	err = r.Session.DoRequest("SoftLayer_Ticket", "createStandardTicket", params, &r.Options, &resp)
265	return
266}
267
268// Create a ticket for the SoftLayer sales team to perform a hardware or service upgrade. Our sales team will work with you on upgrade feasibility and pricing and then send the upgrade ticket to the proper department to perform the actual upgrade. Service affecting upgrades, such as server hardware or CloudLayer Computing Instance upgrades that require the server powered down must have a two hour maintenance specified for our datacenter engineers to perform your upgrade. Account level upgrades, such as adding PPTP VPN users, CDNLayer accounts, and monitoring services are processed much faster and do not require a maintenance window.
269func (r Ticket) CreateUpgradeTicket(attachmentId *int, genericUpgrade *string, upgradeMaintenanceWindow *string, details *string, attachmentType *string, title *string) (resp datatypes.Ticket, err error) {
270	params := []interface{}{
271		attachmentId,
272		genericUpgrade,
273		upgradeMaintenanceWindow,
274		details,
275		attachmentType,
276		title,
277	}
278	err = r.Session.DoRequest("SoftLayer_Ticket", "createUpgradeTicket", params, &r.Options, &resp)
279	return
280}
281
282// Edit a SoftLayer ticket. The edit method is two-fold. You may either edit a ticket itself, add an update to a ticket, attach up to two files to a ticket, or perform all of these tasks. The SoftLayer API ignores changes made to the ''userEditableFlag''  and ''accountId'' properties. You may not assign a ticket to a user that your API account does not have access to. You may not enter a custom title for standard support tickets, buy may do so when editing an administrative ticket. Finally, you may not close a ticket using this method. Please contact SoftLayer if you need a ticket closed.
283//
284// If you need to only add an update to a ticket then please use the [[SoftLayer_Ticket::addUpdate|addUpdate]] method in this service. Likewise if you need to only attach a file to a ticket then use the [[SoftLayer_Ticket::addAttachedFile|addAttachedFile]] method. The edit method exists as a convenience if you need to perform all these tasks at once.
285func (r Ticket) Edit(templateObject *datatypes.Ticket, contents *string, attachedFiles []datatypes.Container_Utility_File_Attachment) (resp datatypes.Ticket, err error) {
286	params := []interface{}{
287		templateObject,
288		contents,
289		attachedFiles,
290	}
291	err = r.Session.DoRequest("SoftLayer_Ticket", "edit", params, &r.Options, &resp)
292	return
293}
294
295// Retrieve The SoftLayer customer account associated with a ticket.
296func (r Ticket) GetAccount() (resp datatypes.Account, err error) {
297	err = r.Session.DoRequest("SoftLayer_Ticket", "getAccount", nil, &r.Options, &resp)
298	return
299}
300
301// getAllTicketGroups() retrieves a list of all groups that a ticket may be assigned to. Ticket groups represent the internal department at SoftLayer who a ticket is assigned to.
302//
303// Every SoftLayer ticket has groupId and ticketGroup properties that correspond to one of the groups returned by getAllTicketGroups().
304func (r Ticket) GetAllTicketGroups() (resp []datatypes.Ticket_Group, err error) {
305	err = r.Session.DoRequest("SoftLayer_Ticket", "getAllTicketGroups", nil, &r.Options, &resp)
306	return
307}
308
309// getAllTicketStatuses() retrieves a list of all statuses that a ticket may exist in. Ticket status represent the current state of a ticket, usually "open", "assigned", and "closed".
310//
311// Every SoftLayer ticket has statusId and status properties that correspond to one of the statuses returned by getAllTicketStatuses().
312func (r Ticket) GetAllTicketStatuses() (resp []datatypes.Ticket_Status, err error) {
313	err = r.Session.DoRequest("SoftLayer_Ticket", "getAllTicketStatuses", nil, &r.Options, &resp)
314	return
315}
316
317// Retrieve
318func (r Ticket) GetAssignedAgents() (resp []datatypes.User_Customer, err error) {
319	err = r.Session.DoRequest("SoftLayer_Ticket", "getAssignedAgents", nil, &r.Options, &resp)
320	return
321}
322
323// Retrieve The portal user that a ticket is assigned to.
324func (r Ticket) GetAssignedUser() (resp datatypes.User_Customer, err error) {
325	err = r.Session.DoRequest("SoftLayer_Ticket", "getAssignedUser", nil, &r.Options, &resp)
326	return
327}
328
329// Retrieve The list of additional emails to notify when a ticket update is made.
330func (r Ticket) GetAttachedAdditionalEmails() (resp []datatypes.User_Customer_AdditionalEmail, err error) {
331	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedAdditionalEmails", nil, &r.Options, &resp)
332	return
333}
334
335// Retrieve The Dedicated Hosts associated with a ticket. This is used in cases where a ticket is directly associated with one or more Dedicated Hosts.
336func (r Ticket) GetAttachedDedicatedHosts() (resp []datatypes.Virtual_DedicatedHost, err error) {
337	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedDedicatedHosts", nil, &r.Options, &resp)
338	return
339}
340
341// Retrieve the file attached to a SoftLayer ticket by it's given identifier. To retrieve a list of files attached to a ticket either call the SoftLayer_Ticket::getAttachedFiles method or call SoftLayer_Ticket::getObject with ''attachedFiles'' defined in an object mask.
342func (r Ticket) GetAttachedFile(attachmentId *int) (resp []byte, err error) {
343	params := []interface{}{
344		attachmentId,
345	}
346	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedFile", params, &r.Options, &resp)
347	return
348}
349
350// Retrieve The files attached to a ticket.
351func (r Ticket) GetAttachedFiles() (resp []datatypes.Ticket_Attachment_File, err error) {
352	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedFiles", nil, &r.Options, &resp)
353	return
354}
355
356// Retrieve The hardware associated with a ticket. This is used in cases where a ticket is directly associated with one or more pieces of hardware.
357func (r Ticket) GetAttachedHardware() (resp []datatypes.Hardware, err error) {
358	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedHardware", nil, &r.Options, &resp)
359	return
360}
361
362// Retrieve
363func (r Ticket) GetAttachedHardwareCount() (resp uint, err error) {
364	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedHardwareCount", nil, &r.Options, &resp)
365	return
366}
367
368// Retrieve
369func (r Ticket) GetAttachedResources() (resp []datatypes.Ticket_Attachment, err error) {
370	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedResources", nil, &r.Options, &resp)
371	return
372}
373
374// Retrieve The virtual guests associated with a ticket. This is used in cases where a ticket is directly associated with one or more virtualized guests installations or Virtual Servers.
375func (r Ticket) GetAttachedVirtualGuests() (resp []datatypes.Virtual_Guest, err error) {
376	err = r.Session.DoRequest("SoftLayer_Ticket", "getAttachedVirtualGuests", nil, &r.Options, &resp)
377	return
378}
379
380// Retrieve Ticket is waiting on a response from a customer flag.
381func (r Ticket) GetAwaitingUserResponseFlag() (resp bool, err error) {
382	err = r.Session.DoRequest("SoftLayer_Ticket", "getAwaitingUserResponseFlag", nil, &r.Options, &resp)
383	return
384}
385
386// Retrieve A service cancellation request.
387func (r Ticket) GetCancellationRequest() (resp datatypes.Billing_Item_Cancellation_Request, err error) {
388	err = r.Session.DoRequest("SoftLayer_Ticket", "getCancellationRequest", nil, &r.Options, &resp)
389	return
390}
391
392// Retrieve
393func (r Ticket) GetEmployeeAttachments() (resp []datatypes.User_Employee, err error) {
394	err = r.Session.DoRequest("SoftLayer_Ticket", "getEmployeeAttachments", nil, &r.Options, &resp)
395	return
396}
397
398// Retrieve A ticket's associated EU compliant record
399func (r Ticket) GetEuSupportedFlag() (resp bool, err error) {
400	err = r.Session.DoRequest("SoftLayer_Ticket", "getEuSupportedFlag", nil, &r.Options, &resp)
401	return
402}
403
404// Retrieve The first physical or virtual server attached to a ticket.
405func (r Ticket) GetFirstAttachedResource() (resp datatypes.Ticket_Attachment, err error) {
406	err = r.Session.DoRequest("SoftLayer_Ticket", "getFirstAttachedResource", nil, &r.Options, &resp)
407	return
408}
409
410// Retrieve The first update made to a ticket. This is typically the contents of a ticket when it's created.
411func (r Ticket) GetFirstUpdate() (resp datatypes.Ticket_Update, err error) {
412	err = r.Session.DoRequest("SoftLayer_Ticket", "getFirstUpdate", nil, &r.Options, &resp)
413	return
414}
415
416// Retrieve The SoftLayer department that a ticket is assigned to.
417func (r Ticket) GetGroup() (resp datatypes.Ticket_Group, err error) {
418	err = r.Session.DoRequest("SoftLayer_Ticket", "getGroup", nil, &r.Options, &resp)
419	return
420}
421
422// Retrieve The invoice items associated with a ticket. Ticket based invoice items only exist when a ticket incurs a fee that has been invoiced.
423func (r Ticket) GetInvoiceItems() (resp []datatypes.Billing_Invoice_Item, err error) {
424	err = r.Session.DoRequest("SoftLayer_Ticket", "getInvoiceItems", nil, &r.Options, &resp)
425	return
426}
427
428// Retrieve
429func (r Ticket) GetLastActivity() (resp datatypes.Ticket_Activity, err error) {
430	err = r.Session.DoRequest("SoftLayer_Ticket", "getLastActivity", nil, &r.Options, &resp)
431	return
432}
433
434// Retrieve
435func (r Ticket) GetLastEditor() (resp datatypes.User_Interface, err error) {
436	err = r.Session.DoRequest("SoftLayer_Ticket", "getLastEditor", nil, &r.Options, &resp)
437	return
438}
439
440// Retrieve The last update made to a ticket.
441func (r Ticket) GetLastUpdate() (resp datatypes.Ticket_Update, err error) {
442	err = r.Session.DoRequest("SoftLayer_Ticket", "getLastUpdate", nil, &r.Options, &resp)
443	return
444}
445
446// Retrieve A timestamp of the last time the Ticket was viewed by the active user.
447func (r Ticket) GetLastViewedDate() (resp datatypes.Time, err error) {
448	err = r.Session.DoRequest("SoftLayer_Ticket", "getLastViewedDate", nil, &r.Options, &resp)
449	return
450}
451
452// Retrieve A ticket's associated location within the SoftLayer location hierarchy.
453func (r Ticket) GetLocation() (resp datatypes.Location, err error) {
454	err = r.Session.DoRequest("SoftLayer_Ticket", "getLocation", nil, &r.Options, &resp)
455	return
456}
457
458// Retrieve True if there are new, unread updates to this ticket for the current user, False otherwise.
459func (r Ticket) GetNewUpdatesFlag() (resp bool, err error) {
460	err = r.Session.DoRequest("SoftLayer_Ticket", "getNewUpdatesFlag", nil, &r.Options, &resp)
461	return
462}
463
464// getObject retrieves the SoftLayer_Ticket object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Ticket service. You can only retrieve tickets that are associated with your SoftLayer customer account.
465func (r Ticket) GetObject() (resp datatypes.Ticket, err error) {
466	err = r.Session.DoRequest("SoftLayer_Ticket", "getObject", nil, &r.Options, &resp)
467	return
468}
469
470// Retrieve
471func (r Ticket) GetScheduledActions() (resp []datatypes.Provisioning_Version1_Transaction, err error) {
472	err = r.Session.DoRequest("SoftLayer_Ticket", "getScheduledActions", nil, &r.Options, &resp)
473	return
474}
475
476// Retrieve The invoice associated with a ticket. Only tickets with an associated administrative charge have an invoice.
477func (r Ticket) GetServerAdministrationBillingInvoice() (resp datatypes.Billing_Invoice, err error) {
478	err = r.Session.DoRequest("SoftLayer_Ticket", "getServerAdministrationBillingInvoice", nil, &r.Options, &resp)
479	return
480}
481
482// Retrieve The refund invoice associated with a ticket. Only tickets with a refund applied in them have an associated refund invoice.
483func (r Ticket) GetServerAdministrationRefundInvoice() (resp datatypes.Billing_Invoice, err error) {
484	err = r.Session.DoRequest("SoftLayer_Ticket", "getServerAdministrationRefundInvoice", nil, &r.Options, &resp)
485	return
486}
487
488// Retrieve
489func (r Ticket) GetServiceProvider() (resp datatypes.Service_Provider, err error) {
490	err = r.Session.DoRequest("SoftLayer_Ticket", "getServiceProvider", nil, &r.Options, &resp)
491	return
492}
493
494// Retrieve
495func (r Ticket) GetState() (resp []datatypes.Ticket_State, err error) {
496	err = r.Session.DoRequest("SoftLayer_Ticket", "getState", nil, &r.Options, &resp)
497	return
498}
499
500// Retrieve A ticket's status.
501func (r Ticket) GetStatus() (resp datatypes.Ticket_Status, err error) {
502	err = r.Session.DoRequest("SoftLayer_Ticket", "getStatus", nil, &r.Options, &resp)
503	return
504}
505
506// Retrieve A ticket's subject. Only standard support tickets have an associated subject. A standard support ticket's title corresponds with it's subject's name.
507func (r Ticket) GetSubject() (resp datatypes.Ticket_Subject, err error) {
508	err = r.Session.DoRequest("SoftLayer_Ticket", "getSubject", nil, &r.Options, &resp)
509	return
510}
511
512// Retrieve
513func (r Ticket) GetTagReferences() (resp []datatypes.Tag_Reference, err error) {
514	err = r.Session.DoRequest("SoftLayer_Ticket", "getTagReferences", nil, &r.Options, &resp)
515	return
516}
517
518// Retrieve all tickets closed since a given date.
519func (r Ticket) GetTicketsClosedSinceDate(closeDate *datatypes.Time) (resp []datatypes.Ticket, err error) {
520	params := []interface{}{
521		closeDate,
522	}
523	err = r.Session.DoRequest("SoftLayer_Ticket", "getTicketsClosedSinceDate", params, &r.Options, &resp)
524	return
525}
526
527// Retrieve A ticket's updates.
528func (r Ticket) GetUpdates() (resp []datatypes.Ticket_Update, err error) {
529	err = r.Session.DoRequest("SoftLayer_Ticket", "getUpdates", nil, &r.Options, &resp)
530	return
531}
532
533// Mark a ticket as viewed.  All currently posted updates will be marked as viewed. The lastViewedDate property will be updated to the current time.
534func (r Ticket) MarkAsViewed() (err error) {
535	var resp datatypes.Void
536	err = r.Session.DoRequest("SoftLayer_Ticket", "markAsViewed", nil, &r.Options, &resp)
537	return
538}
539
540//
541//
542//
543func (r Ticket) RemoveAssignedAgent(agentId *int) (err error) {
544	var resp datatypes.Void
545	params := []interface{}{
546		agentId,
547	}
548	err = r.Session.DoRequest("SoftLayer_Ticket", "removeAssignedAgent", params, &r.Options, &resp)
549	return
550}
551
552// removeAttachedAdditionalEmails() removes the specified email addresses from a ticket's notification list. If one of the provided email addresses is not attached to the ticket then ''removeAttachedAdditiaonalEmails()'' ignores it and continues to the next one. Once the email addresses are removed ''removeAttachedAdditiaonalEmails()'' returns a boolean true.
553func (r Ticket) RemoveAttachedAdditionalEmails(emails []string) (resp bool, err error) {
554	params := []interface{}{
555		emails,
556	}
557	err = r.Session.DoRequest("SoftLayer_Ticket", "removeAttachedAdditionalEmails", params, &r.Options, &resp)
558	return
559}
560
561// detach the given hardware from a SoftLayer ticket. Removing a hardware attachment may delay ticket processing time if the hardware removed is relevant to the ticket's issue. Return a boolean true upon successful hardware detachment.
562func (r Ticket) RemoveAttachedHardware(hardwareId *int) (resp bool, err error) {
563	params := []interface{}{
564		hardwareId,
565	}
566	err = r.Session.DoRequest("SoftLayer_Ticket", "removeAttachedHardware", params, &r.Options, &resp)
567	return
568}
569
570// Detach the given CloudLayer Computing Instance from a SoftLayer ticket. Removing an attachment may delay ticket processing time if the instance removed is relevant to the ticket's issue. Return a boolean true upon successful detachment.
571func (r Ticket) RemoveAttachedVirtualGuest(guestId *int) (resp bool, err error) {
572	params := []interface{}{
573		guestId,
574	}
575	err = r.Session.DoRequest("SoftLayer_Ticket", "removeAttachedVirtualGuest", params, &r.Options, &resp)
576	return
577}
578
579// no documentation yet
580func (r Ticket) RemoveScheduledAlert() (err error) {
581	var resp datatypes.Void
582	err = r.Session.DoRequest("SoftLayer_Ticket", "removeScheduledAlert", nil, &r.Options, &resp)
583	return
584}
585
586// no documentation yet
587func (r Ticket) RemoveScheduledAutoClose() (err error) {
588	var resp datatypes.Void
589	err = r.Session.DoRequest("SoftLayer_Ticket", "removeScheduledAutoClose", nil, &r.Options, &resp)
590	return
591}
592
593// no documentation yet
594func (r Ticket) SetTags(tags *string) (resp bool, err error) {
595	params := []interface{}{
596		tags,
597	}
598	err = r.Session.DoRequest("SoftLayer_Ticket", "setTags", params, &r.Options, &resp)
599	return
600}
601
602// (DEPRECATED) Use [[SoftLayer_Ticket_Survey::getPreference]] method.
603func (r Ticket) SurveyEligible() (resp bool, err error) {
604	err = r.Session.DoRequest("SoftLayer_Ticket", "surveyEligible", nil, &r.Options, &resp)
605	return
606}
607
608// Creates new additional emails for assigned user if new emails are provided. Attaches any newly created additional emails to ticket. Remove any additional emails from a ticket that are not provided as part of $emails
609func (r Ticket) UpdateAttachedAdditionalEmails(emails []string) (resp bool, err error) {
610	params := []interface{}{
611		emails,
612	}
613	err = r.Session.DoRequest("SoftLayer_Ticket", "updateAttachedAdditionalEmails", params, &r.Options, &resp)
614	return
615}
616
617// SoftLayer tickets can have have files attached to them. Attaching a file to a ticket is a good way to report issues, provide documentation, and give examples of an issue. Both SoftLayer customers and employees have the ability to attach files to a ticket. The SoftLayer_Ticket_Attachment_File data type models a single file attached to a ticket.
618type Ticket_Attachment_File struct {
619	Session *session.Session
620	Options sl.Options
621}
622
623// GetTicketAttachmentFileService returns an instance of the Ticket_Attachment_File SoftLayer service
624func GetTicketAttachmentFileService(sess *session.Session) Ticket_Attachment_File {
625	return Ticket_Attachment_File{Session: sess}
626}
627
628func (r Ticket_Attachment_File) Id(id int) Ticket_Attachment_File {
629	r.Options.Id = &id
630	return r
631}
632
633func (r Ticket_Attachment_File) Mask(mask string) Ticket_Attachment_File {
634	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
635		mask = fmt.Sprintf("mask[%s]", mask)
636	}
637
638	r.Options.Mask = mask
639	return r
640}
641
642func (r Ticket_Attachment_File) Filter(filter string) Ticket_Attachment_File {
643	r.Options.Filter = filter
644	return r
645}
646
647func (r Ticket_Attachment_File) Limit(limit int) Ticket_Attachment_File {
648	r.Options.Limit = &limit
649	return r
650}
651
652func (r Ticket_Attachment_File) Offset(offset int) Ticket_Attachment_File {
653	r.Options.Offset = &offset
654	return r
655}
656
657// no documentation yet
658func (r Ticket_Attachment_File) GetExtensionWhitelist() (resp []string, err error) {
659	err = r.Session.DoRequest("SoftLayer_Ticket_Attachment_File", "getExtensionWhitelist", nil, &r.Options, &resp)
660	return
661}
662
663// no documentation yet
664func (r Ticket_Attachment_File) GetObject() (resp datatypes.Ticket_Attachment_File, err error) {
665	err = r.Session.DoRequest("SoftLayer_Ticket_Attachment_File", "getObject", nil, &r.Options, &resp)
666	return
667}
668
669// Retrieve
670func (r Ticket_Attachment_File) GetTicket() (resp datatypes.Ticket, err error) {
671	err = r.Session.DoRequest("SoftLayer_Ticket_Attachment_File", "getTicket", nil, &r.Options, &resp)
672	return
673}
674
675// Retrieve The ticket that a file is attached to.
676func (r Ticket_Attachment_File) GetUpdate() (resp datatypes.Ticket_Update, err error) {
677	err = r.Session.DoRequest("SoftLayer_Ticket_Attachment_File", "getUpdate", nil, &r.Options, &resp)
678	return
679}
680
681// no documentation yet
682type Ticket_Priority struct {
683	Session *session.Session
684	Options sl.Options
685}
686
687// GetTicketPriorityService returns an instance of the Ticket_Priority SoftLayer service
688func GetTicketPriorityService(sess *session.Session) Ticket_Priority {
689	return Ticket_Priority{Session: sess}
690}
691
692func (r Ticket_Priority) Id(id int) Ticket_Priority {
693	r.Options.Id = &id
694	return r
695}
696
697func (r Ticket_Priority) Mask(mask string) Ticket_Priority {
698	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
699		mask = fmt.Sprintf("mask[%s]", mask)
700	}
701
702	r.Options.Mask = mask
703	return r
704}
705
706func (r Ticket_Priority) Filter(filter string) Ticket_Priority {
707	r.Options.Filter = filter
708	return r
709}
710
711func (r Ticket_Priority) Limit(limit int) Ticket_Priority {
712	r.Options.Limit = &limit
713	return r
714}
715
716func (r Ticket_Priority) Offset(offset int) Ticket_Priority {
717	r.Options.Offset = &offset
718	return r
719}
720
721// no documentation yet
722func (r Ticket_Priority) GetPriorities() (resp []datatypes.Container_Ticket_Priority, err error) {
723	err = r.Session.DoRequest("SoftLayer_Ticket_Priority", "getPriorities", nil, &r.Options, &resp)
724	return
725}
726
727// The SoftLayer_Ticket_Subject data type models one of the possible subjects that a standard support ticket may belong to. A basic support ticket's title matches it's corresponding subject's name.
728type Ticket_Subject struct {
729	Session *session.Session
730	Options sl.Options
731}
732
733// GetTicketSubjectService returns an instance of the Ticket_Subject SoftLayer service
734func GetTicketSubjectService(sess *session.Session) Ticket_Subject {
735	return Ticket_Subject{Session: sess}
736}
737
738func (r Ticket_Subject) Id(id int) Ticket_Subject {
739	r.Options.Id = &id
740	return r
741}
742
743func (r Ticket_Subject) Mask(mask string) Ticket_Subject {
744	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
745		mask = fmt.Sprintf("mask[%s]", mask)
746	}
747
748	r.Options.Mask = mask
749	return r
750}
751
752func (r Ticket_Subject) Filter(filter string) Ticket_Subject {
753	r.Options.Filter = filter
754	return r
755}
756
757func (r Ticket_Subject) Limit(limit int) Ticket_Subject {
758	r.Options.Limit = &limit
759	return r
760}
761
762func (r Ticket_Subject) Offset(offset int) Ticket_Subject {
763	r.Options.Offset = &offset
764	return r
765}
766
767// Retrieve all possible ticket subjects. The SoftLayer customer portal uses this method in the add standard support ticket form.
768func (r Ticket_Subject) GetAllObjects() (resp []datatypes.Ticket_Subject, err error) {
769	err = r.Session.DoRequest("SoftLayer_Ticket_Subject", "getAllObjects", nil, &r.Options, &resp)
770	return
771}
772
773// Retrieve
774func (r Ticket_Subject) GetCategory() (resp datatypes.Ticket_Subject_Category, err error) {
775	err = r.Session.DoRequest("SoftLayer_Ticket_Subject", "getCategory", nil, &r.Options, &resp)
776	return
777}
778
779// Retrieve A child subject
780func (r Ticket_Subject) GetChildren() (resp []datatypes.Ticket_Subject, err error) {
781	err = r.Session.DoRequest("SoftLayer_Ticket_Subject", "getChildren", nil, &r.Options, &resp)
782	return
783}
784
785// Retrieve
786func (r Ticket_Subject) GetGroup() (resp datatypes.Ticket_Group, err error) {
787	err = r.Session.DoRequest("SoftLayer_Ticket_Subject", "getGroup", nil, &r.Options, &resp)
788	return
789}
790
791// getObject retrieves the SoftLayer_Ticket_Subject object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Ticket_Subject service.
792func (r Ticket_Subject) GetObject() (resp datatypes.Ticket_Subject, err error) {
793	err = r.Session.DoRequest("SoftLayer_Ticket_Subject", "getObject", nil, &r.Options, &resp)
794	return
795}
796
797// Retrieve A parent subject
798func (r Ticket_Subject) GetParent() (resp datatypes.Ticket_Subject, err error) {
799	err = r.Session.DoRequest("SoftLayer_Ticket_Subject", "getParent", nil, &r.Options, &resp)
800	return
801}
802
803// SoftLayer maintains relationships between the generic subjects for standard administration and the top five commonly asked questions about these subjects. getTopFileKnowledgeLayerQuestions() retrieves the top five questions and answers from the SoftLayer KnowledgeLayer related to the given ticket subject.
804func (r Ticket_Subject) GetTopFiveKnowledgeLayerQuestions() (resp []datatypes.Container_KnowledgeLayer_QuestionAnswer, err error) {
805	err = r.Session.DoRequest("SoftLayer_Ticket_Subject", "getTopFiveKnowledgeLayerQuestions", nil, &r.Options, &resp)
806	return
807}
808
809// SoftLayer_Ticket_Subject_Category groups ticket subjects into logical group.
810type Ticket_Subject_Category struct {
811	Session *session.Session
812	Options sl.Options
813}
814
815// GetTicketSubjectCategoryService returns an instance of the Ticket_Subject_Category SoftLayer service
816func GetTicketSubjectCategoryService(sess *session.Session) Ticket_Subject_Category {
817	return Ticket_Subject_Category{Session: sess}
818}
819
820func (r Ticket_Subject_Category) Id(id int) Ticket_Subject_Category {
821	r.Options.Id = &id
822	return r
823}
824
825func (r Ticket_Subject_Category) Mask(mask string) Ticket_Subject_Category {
826	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
827		mask = fmt.Sprintf("mask[%s]", mask)
828	}
829
830	r.Options.Mask = mask
831	return r
832}
833
834func (r Ticket_Subject_Category) Filter(filter string) Ticket_Subject_Category {
835	r.Options.Filter = filter
836	return r
837}
838
839func (r Ticket_Subject_Category) Limit(limit int) Ticket_Subject_Category {
840	r.Options.Limit = &limit
841	return r
842}
843
844func (r Ticket_Subject_Category) Offset(offset int) Ticket_Subject_Category {
845	r.Options.Offset = &offset
846	return r
847}
848
849// Retrieve all ticket subject categories.
850func (r Ticket_Subject_Category) GetAllObjects() (resp []datatypes.Ticket_Subject_Category, err error) {
851	err = r.Session.DoRequest("SoftLayer_Ticket_Subject_Category", "getAllObjects", nil, &r.Options, &resp)
852	return
853}
854
855// no documentation yet
856func (r Ticket_Subject_Category) GetObject() (resp datatypes.Ticket_Subject_Category, err error) {
857	err = r.Session.DoRequest("SoftLayer_Ticket_Subject_Category", "getObject", nil, &r.Options, &resp)
858	return
859}
860
861// Retrieve
862func (r Ticket_Subject_Category) GetSubjects() (resp []datatypes.Ticket_Subject, err error) {
863	err = r.Session.DoRequest("SoftLayer_Ticket_Subject_Category", "getSubjects", nil, &r.Options, &resp)
864	return
865}
866
867// no documentation yet
868type Ticket_Survey struct {
869	Session *session.Session
870	Options sl.Options
871}
872
873// GetTicketSurveyService returns an instance of the Ticket_Survey SoftLayer service
874func GetTicketSurveyService(sess *session.Session) Ticket_Survey {
875	return Ticket_Survey{Session: sess}
876}
877
878func (r Ticket_Survey) Id(id int) Ticket_Survey {
879	r.Options.Id = &id
880	return r
881}
882
883func (r Ticket_Survey) Mask(mask string) Ticket_Survey {
884	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
885		mask = fmt.Sprintf("mask[%s]", mask)
886	}
887
888	r.Options.Mask = mask
889	return r
890}
891
892func (r Ticket_Survey) Filter(filter string) Ticket_Survey {
893	r.Options.Filter = filter
894	return r
895}
896
897func (r Ticket_Survey) Limit(limit int) Ticket_Survey {
898	r.Options.Limit = &limit
899	return r
900}
901
902func (r Ticket_Survey) Offset(offset int) Ticket_Survey {
903	r.Options.Offset = &offset
904	return r
905}
906
907// Use this method to retrieve the ticket survey preferences. It will return your [[SoftLayer_Container_Ticket_Survey_Preference|survey preference]] which indicates if your account is applicable to receive a survey and if you're opted in. You can control the survey opt via the [[SoftLayer_Ticket_Survey::optIn|opt-in]] or [[SoftLayer_Ticket_Survey::optOut|opt-out]] method.
908func (r Ticket_Survey) GetPreference() (resp datatypes.Container_Ticket_Survey_Preference, err error) {
909	err = r.Session.DoRequest("SoftLayer_Ticket_Survey", "getPreference", nil, &r.Options, &resp)
910	return
911}
912
913// You will not receive a ticket survey if you are opted out. Use this method to opt back in if you wish to provide feedback to our support team. You may use the [[SoftLayer_Ticket_Survey::getPreference|getPreference]] method to check your current opt status.
914//
915// This method is depricated. Use [[SoftLayer_User_Customer::changePreference]] instead.
916func (r Ticket_Survey) OptIn() (resp datatypes.Container_Ticket_Survey_Preference, err error) {
917	err = r.Session.DoRequest("SoftLayer_Ticket_Survey", "optIn", nil, &r.Options, &resp)
918	return
919}
920
921// By default, customers will occasionally receive a ticket survey upon closing of a ticket. Use this method to opt out of it for the next 90 days. Ticket surveys may not be applicable for some customers. Use the [[SoftLayer_Ticket_Survey::getPreference|getPreference]] method to retrieve your survey preference. The "applicable" property of the [[SoftLayer_Container_Ticket_Survey_Preference|survey preference]] indicates if the survey is relevant to your account or not.
922//
923// This method is depricated. Use [[SoftLayer_User_Customer::changePreference]] instead.
924func (r Ticket_Survey) OptOut() (resp datatypes.Container_Ticket_Survey_Preference, err error) {
925	err = r.Session.DoRequest("SoftLayer_Ticket_Survey", "optOut", nil, &r.Options, &resp)
926	return
927}
928
929// The SoftLayer_Ticket_Update_Employee data type models an update to a ticket made by a SoftLayer employee.
930type Ticket_Update_Employee struct {
931	Session *session.Session
932	Options sl.Options
933}
934
935// GetTicketUpdateEmployeeService returns an instance of the Ticket_Update_Employee SoftLayer service
936func GetTicketUpdateEmployeeService(sess *session.Session) Ticket_Update_Employee {
937	return Ticket_Update_Employee{Session: sess}
938}
939
940func (r Ticket_Update_Employee) Id(id int) Ticket_Update_Employee {
941	r.Options.Id = &id
942	return r
943}
944
945func (r Ticket_Update_Employee) Mask(mask string) Ticket_Update_Employee {
946	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
947		mask = fmt.Sprintf("mask[%s]", mask)
948	}
949
950	r.Options.Mask = mask
951	return r
952}
953
954func (r Ticket_Update_Employee) Filter(filter string) Ticket_Update_Employee {
955	r.Options.Filter = filter
956	return r
957}
958
959func (r Ticket_Update_Employee) Limit(limit int) Ticket_Update_Employee {
960	r.Options.Limit = &limit
961	return r
962}
963
964func (r Ticket_Update_Employee) Offset(offset int) Ticket_Update_Employee {
965	r.Options.Offset = &offset
966	return r
967}
968
969// As part of the customer service process SoftLayer has provided a quick feedback mechanism for its customers to rate the responses that its employees give on tickets. addResponseRating() sets the rating for a single ticket update made by a SoftLayer employee. Ticket ratings have the integer values 1 through 5, with 1 being the worst and 5 being the best. Once the rating is set ''addResponseRating()'' returns a boolean true.
970func (r Ticket_Update_Employee) AddResponseRating(responseRating *int) (resp bool, err error) {
971	params := []interface{}{
972		responseRating,
973	}
974	err = r.Session.DoRequest("SoftLayer_Ticket_Update_Employee", "addResponseRating", params, &r.Options, &resp)
975	return
976}
977
978// getObject retrieves the SoftLayer_Ticket_Update_Employee object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Ticket_Update_Employee service. You can only retrieve employee updates to tickets that your API account has access to.
979func (r Ticket_Update_Employee) GetObject() (resp datatypes.Ticket_Update_Employee, err error) {
980	err = r.Session.DoRequest("SoftLayer_Ticket_Update_Employee", "getObject", nil, &r.Options, &resp)
981	return
982}
983