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// SoftLayer_Software_AccountLicense is a class that represents software licenses that are tied only to a customer's account and not to any particular hardware, IP address, etc.
33type Software_AccountLicense struct {
34	Session *session.Session
35	Options sl.Options
36}
37
38// GetSoftwareAccountLicenseService returns an instance of the Software_AccountLicense SoftLayer service
39func GetSoftwareAccountLicenseService(sess *session.Session) Software_AccountLicense {
40	return Software_AccountLicense{Session: sess}
41}
42
43func (r Software_AccountLicense) Id(id int) Software_AccountLicense {
44	r.Options.Id = &id
45	return r
46}
47
48func (r Software_AccountLicense) Mask(mask string) Software_AccountLicense {
49	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
50		mask = fmt.Sprintf("mask[%s]", mask)
51	}
52
53	r.Options.Mask = mask
54	return r
55}
56
57func (r Software_AccountLicense) Filter(filter string) Software_AccountLicense {
58	r.Options.Filter = filter
59	return r
60}
61
62func (r Software_AccountLicense) Limit(limit int) Software_AccountLicense {
63	r.Options.Limit = &limit
64	return r
65}
66
67func (r Software_AccountLicense) Offset(offset int) Software_AccountLicense {
68	r.Options.Offset = &offset
69	return r
70}
71
72// Retrieve The customer account this Account License belongs to.
73func (r Software_AccountLicense) GetAccount() (resp datatypes.Account, err error) {
74	err = r.Session.DoRequest("SoftLayer_Software_AccountLicense", "getAccount", nil, &r.Options, &resp)
75	return
76}
77
78// no documentation yet
79func (r Software_AccountLicense) GetAllObjects() (resp []datatypes.Software_AccountLicense, err error) {
80	err = r.Session.DoRequest("SoftLayer_Software_AccountLicense", "getAllObjects", nil, &r.Options, &resp)
81	return
82}
83
84// Retrieve The billing item for a software account license.
85func (r Software_AccountLicense) GetBillingItem() (resp datatypes.Billing_Item, err error) {
86	err = r.Session.DoRequest("SoftLayer_Software_AccountLicense", "getBillingItem", nil, &r.Options, &resp)
87	return
88}
89
90// no documentation yet
91func (r Software_AccountLicense) GetObject() (resp datatypes.Software_AccountLicense, err error) {
92	err = r.Session.DoRequest("SoftLayer_Software_AccountLicense", "getObject", nil, &r.Options, &resp)
93	return
94}
95
96// Retrieve The SoftLayer_Software_Description that this account license is for.
97func (r Software_AccountLicense) GetSoftwareDescription() (resp datatypes.Software_Description, err error) {
98	err = r.Session.DoRequest("SoftLayer_Software_AccountLicense", "getSoftwareDescription", nil, &r.Options, &resp)
99	return
100}
101
102// A SoftLayer_Software_Component ties the installation of a specific piece of software onto a specific piece of hardware.
103//
104// SoftLayer_Software_Component works with SoftLayer_Software_License and SoftLayer_Software_Description to tie this all together.
105//
106// <ul> <li>SoftLayer_Software_Component is the installation of a specific piece of software onto a specific piece of hardware in accordance to a software license. <ul> <li>SoftLayer_Software_License dictates when and how a specific piece of software may be installed onto a piece of hardware. <ul> <li>SoftLayer_Software_Description describes a specific piece of software which can be installed onto hardware in accordance with it's license agreement. </li></ul></li></ul></li></ul>
107type Software_Component struct {
108	Session *session.Session
109	Options sl.Options
110}
111
112// GetSoftwareComponentService returns an instance of the Software_Component SoftLayer service
113func GetSoftwareComponentService(sess *session.Session) Software_Component {
114	return Software_Component{Session: sess}
115}
116
117func (r Software_Component) Id(id int) Software_Component {
118	r.Options.Id = &id
119	return r
120}
121
122func (r Software_Component) Mask(mask string) Software_Component {
123	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
124		mask = fmt.Sprintf("mask[%s]", mask)
125	}
126
127	r.Options.Mask = mask
128	return r
129}
130
131func (r Software_Component) Filter(filter string) Software_Component {
132	r.Options.Filter = filter
133	return r
134}
135
136func (r Software_Component) Limit(limit int) Software_Component {
137	r.Options.Limit = &limit
138	return r
139}
140
141func (r Software_Component) Offset(offset int) Software_Component {
142	r.Options.Offset = &offset
143	return r
144}
145
146// Retrieve The average amount of time that a software component takes to install.
147func (r Software_Component) GetAverageInstallationDuration() (resp uint, err error) {
148	err = r.Session.DoRequest("SoftLayer_Software_Component", "getAverageInstallationDuration", nil, &r.Options, &resp)
149	return
150}
151
152// Retrieve The billing item for a software component.
153func (r Software_Component) GetBillingItem() (resp datatypes.Billing_Item, err error) {
154	err = r.Session.DoRequest("SoftLayer_Software_Component", "getBillingItem", nil, &r.Options, &resp)
155	return
156}
157
158// Retrieve The hardware this Software Component is installed upon.
159func (r Software_Component) GetHardware() (resp datatypes.Hardware, err error) {
160	err = r.Session.DoRequest("SoftLayer_Software_Component", "getHardware", nil, &r.Options, &resp)
161	return
162}
163
164// Attempt to retrieve the file associated with a software component.  If the software component does not support downloading license files an exception will be thrown.
165func (r Software_Component) GetLicenseFile() (resp string, err error) {
166	err = r.Session.DoRequest("SoftLayer_Software_Component", "getLicenseFile", nil, &r.Options, &resp)
167	return
168}
169
170// getObject retrieves the SoftLayer_Software_Component object whose ID corresponds to the ID number of the init parameter passed to the SoftLayer_Software_Component service.
171//
172// The best way to get software components is through getSoftwareComponents from the Hardware service.
173func (r Software_Component) GetObject() (resp datatypes.Software_Component, err error) {
174	err = r.Session.DoRequest("SoftLayer_Software_Component", "getObject", nil, &r.Options, &resp)
175	return
176}
177
178// Retrieve History Records for Software Passwords.
179func (r Software_Component) GetPasswordHistory() (resp []datatypes.Software_Component_Password_History, err error) {
180	err = r.Session.DoRequest("SoftLayer_Software_Component", "getPasswordHistory", nil, &r.Options, &resp)
181	return
182}
183
184// Retrieve Username/Password pairs used for access to this Software Installation.
185func (r Software_Component) GetPasswords() (resp []datatypes.Software_Component_Password, err error) {
186	err = r.Session.DoRequest("SoftLayer_Software_Component", "getPasswords", nil, &r.Options, &resp)
187	return
188}
189
190// Retrieve The Software Description of this Software Component.
191func (r Software_Component) GetSoftwareDescription() (resp datatypes.Software_Description, err error) {
192	err = r.Session.DoRequest("SoftLayer_Software_Component", "getSoftwareDescription", nil, &r.Options, &resp)
193	return
194}
195
196// Retrieve The License this Software Component uses.
197func (r Software_Component) GetSoftwareLicense() (resp datatypes.Software_License, err error) {
198	err = r.Session.DoRequest("SoftLayer_Software_Component", "getSoftwareLicense", nil, &r.Options, &resp)
199	return
200}
201
202// no documentation yet
203func (r Software_Component) GetVendorSetUpConfiguration() (resp string, err error) {
204	err = r.Session.DoRequest("SoftLayer_Software_Component", "getVendorSetUpConfiguration", nil, &r.Options, &resp)
205	return
206}
207
208// Retrieve The virtual guest this software component is installed upon.
209func (r Software_Component) GetVirtualGuest() (resp datatypes.Virtual_Guest, err error) {
210	err = r.Session.DoRequest("SoftLayer_Software_Component", "getVirtualGuest", nil, &r.Options, &resp)
211	return
212}
213
214// This object specifies a specific type of Software Component:  An Anti-virus/spyware instance. Anti-virus/spyware installations have specific properties and methods such as SoftLayer_Software_Component_AntivirusSpyware::updateAntivirusSpywarePolicy. Defaults are initiated by this object.
215type Software_Component_AntivirusSpyware struct {
216	Session *session.Session
217	Options sl.Options
218}
219
220// GetSoftwareComponentAntivirusSpywareService returns an instance of the Software_Component_AntivirusSpyware SoftLayer service
221func GetSoftwareComponentAntivirusSpywareService(sess *session.Session) Software_Component_AntivirusSpyware {
222	return Software_Component_AntivirusSpyware{Session: sess}
223}
224
225func (r Software_Component_AntivirusSpyware) Id(id int) Software_Component_AntivirusSpyware {
226	r.Options.Id = &id
227	return r
228}
229
230func (r Software_Component_AntivirusSpyware) Mask(mask string) Software_Component_AntivirusSpyware {
231	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
232		mask = fmt.Sprintf("mask[%s]", mask)
233	}
234
235	r.Options.Mask = mask
236	return r
237}
238
239func (r Software_Component_AntivirusSpyware) Filter(filter string) Software_Component_AntivirusSpyware {
240	r.Options.Filter = filter
241	return r
242}
243
244func (r Software_Component_AntivirusSpyware) Limit(limit int) Software_Component_AntivirusSpyware {
245	r.Options.Limit = &limit
246	return r
247}
248
249func (r Software_Component_AntivirusSpyware) Offset(offset int) Software_Component_AntivirusSpyware {
250	r.Options.Offset = &offset
251	return r
252}
253
254// Retrieve The average amount of time that a software component takes to install.
255func (r Software_Component_AntivirusSpyware) GetAverageInstallationDuration() (resp uint, err error) {
256	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getAverageInstallationDuration", nil, &r.Options, &resp)
257	return
258}
259
260// Retrieve The billing item for a software component.
261func (r Software_Component_AntivirusSpyware) GetBillingItem() (resp datatypes.Billing_Item, err error) {
262	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getBillingItem", nil, &r.Options, &resp)
263	return
264}
265
266// Retrieve The hardware this Software Component is installed upon.
267func (r Software_Component_AntivirusSpyware) GetHardware() (resp datatypes.Hardware, err error) {
268	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getHardware", nil, &r.Options, &resp)
269	return
270}
271
272// Attempt to retrieve the file associated with a software component.  If the software component does not support downloading license files an exception will be thrown.
273func (r Software_Component_AntivirusSpyware) GetLicenseFile() (resp string, err error) {
274	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getLicenseFile", nil, &r.Options, &resp)
275	return
276}
277
278// no documentation yet
279func (r Software_Component_AntivirusSpyware) GetObject() (resp datatypes.Software_Component_AntivirusSpyware, err error) {
280	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getObject", nil, &r.Options, &resp)
281	return
282}
283
284// Retrieve History Records for Software Passwords.
285func (r Software_Component_AntivirusSpyware) GetPasswordHistory() (resp []datatypes.Software_Component_Password_History, err error) {
286	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getPasswordHistory", nil, &r.Options, &resp)
287	return
288}
289
290// Retrieve Username/Password pairs used for access to this Software Installation.
291func (r Software_Component_AntivirusSpyware) GetPasswords() (resp []datatypes.Software_Component_Password, err error) {
292	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getPasswords", nil, &r.Options, &resp)
293	return
294}
295
296// Retrieve The Software Description of this Software Component.
297func (r Software_Component_AntivirusSpyware) GetSoftwareDescription() (resp datatypes.Software_Description, err error) {
298	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getSoftwareDescription", nil, &r.Options, &resp)
299	return
300}
301
302// Retrieve The License this Software Component uses.
303func (r Software_Component_AntivirusSpyware) GetSoftwareLicense() (resp datatypes.Software_License, err error) {
304	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getSoftwareLicense", nil, &r.Options, &resp)
305	return
306}
307
308// no documentation yet
309func (r Software_Component_AntivirusSpyware) GetVendorSetUpConfiguration() (resp string, err error) {
310	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getVendorSetUpConfiguration", nil, &r.Options, &resp)
311	return
312}
313
314// Retrieve The virtual guest this software component is installed upon.
315func (r Software_Component_AntivirusSpyware) GetVirtualGuest() (resp datatypes.Virtual_Guest, err error) {
316	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "getVirtualGuest", nil, &r.Options, &resp)
317	return
318}
319
320// Update an anti-virus/spyware policy. The policy options that it accepts are the following:
321// *1 - Minimal
322// *2 - Relaxed
323// *3 - Default
324// *4 - High
325// *5 - Ultimate
326func (r Software_Component_AntivirusSpyware) UpdateAntivirusSpywarePolicy(newPolicy *string, enforce *bool) (resp bool, err error) {
327	params := []interface{}{
328		newPolicy,
329		enforce,
330	}
331	err = r.Session.DoRequest("SoftLayer_Software_Component_AntivirusSpyware", "updateAntivirusSpywarePolicy", params, &r.Options, &resp)
332	return
333}
334
335// This object specifies a specific type of Software Component:  A Host Intrusion Protection System instance.
336type Software_Component_HostIps struct {
337	Session *session.Session
338	Options sl.Options
339}
340
341// GetSoftwareComponentHostIpsService returns an instance of the Software_Component_HostIps SoftLayer service
342func GetSoftwareComponentHostIpsService(sess *session.Session) Software_Component_HostIps {
343	return Software_Component_HostIps{Session: sess}
344}
345
346func (r Software_Component_HostIps) Id(id int) Software_Component_HostIps {
347	r.Options.Id = &id
348	return r
349}
350
351func (r Software_Component_HostIps) Mask(mask string) Software_Component_HostIps {
352	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
353		mask = fmt.Sprintf("mask[%s]", mask)
354	}
355
356	r.Options.Mask = mask
357	return r
358}
359
360func (r Software_Component_HostIps) Filter(filter string) Software_Component_HostIps {
361	r.Options.Filter = filter
362	return r
363}
364
365func (r Software_Component_HostIps) Limit(limit int) Software_Component_HostIps {
366	r.Options.Limit = &limit
367	return r
368}
369
370func (r Software_Component_HostIps) Offset(offset int) Software_Component_HostIps {
371	r.Options.Offset = &offset
372	return r
373}
374
375// Retrieve The average amount of time that a software component takes to install.
376func (r Software_Component_HostIps) GetAverageInstallationDuration() (resp uint, err error) {
377	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getAverageInstallationDuration", nil, &r.Options, &resp)
378	return
379}
380
381// Retrieve The billing item for a software component.
382func (r Software_Component_HostIps) GetBillingItem() (resp datatypes.Billing_Item, err error) {
383	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getBillingItem", nil, &r.Options, &resp)
384	return
385}
386
387// Get the current Host IPS policies.
388func (r Software_Component_HostIps) GetCurrentHostIpsPolicies() (resp []datatypes.Container_Software_Component_HostIps_Policy, err error) {
389	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getCurrentHostIpsPolicies", nil, &r.Options, &resp)
390	return
391}
392
393// Retrieve The hardware this Software Component is installed upon.
394func (r Software_Component_HostIps) GetHardware() (resp datatypes.Hardware, err error) {
395	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getHardware", nil, &r.Options, &resp)
396	return
397}
398
399// Attempt to retrieve the file associated with a software component.  If the software component does not support downloading license files an exception will be thrown.
400func (r Software_Component_HostIps) GetLicenseFile() (resp string, err error) {
401	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getLicenseFile", nil, &r.Options, &resp)
402	return
403}
404
405// no documentation yet
406func (r Software_Component_HostIps) GetObject() (resp datatypes.Software_Component_HostIps, err error) {
407	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getObject", nil, &r.Options, &resp)
408	return
409}
410
411// Retrieve History Records for Software Passwords.
412func (r Software_Component_HostIps) GetPasswordHistory() (resp []datatypes.Software_Component_Password_History, err error) {
413	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getPasswordHistory", nil, &r.Options, &resp)
414	return
415}
416
417// Retrieve Username/Password pairs used for access to this Software Installation.
418func (r Software_Component_HostIps) GetPasswords() (resp []datatypes.Software_Component_Password, err error) {
419	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getPasswords", nil, &r.Options, &resp)
420	return
421}
422
423// Retrieve The Software Description of this Software Component.
424func (r Software_Component_HostIps) GetSoftwareDescription() (resp datatypes.Software_Description, err error) {
425	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getSoftwareDescription", nil, &r.Options, &resp)
426	return
427}
428
429// Retrieve The License this Software Component uses.
430func (r Software_Component_HostIps) GetSoftwareLicense() (resp datatypes.Software_License, err error) {
431	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getSoftwareLicense", nil, &r.Options, &resp)
432	return
433}
434
435// no documentation yet
436func (r Software_Component_HostIps) GetVendorSetUpConfiguration() (resp string, err error) {
437	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getVendorSetUpConfiguration", nil, &r.Options, &resp)
438	return
439}
440
441// Retrieve The virtual guest this software component is installed upon.
442func (r Software_Component_HostIps) GetVirtualGuest() (resp datatypes.Virtual_Guest, err error) {
443	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "getVirtualGuest", nil, &r.Options, &resp)
444	return
445}
446
447// Update the Host IPS policies. To retrieve valid policy options you must use the provided relationships.
448func (r Software_Component_HostIps) UpdateHipsPolicies(newIpsMode *string, newIpsProtection *string, newFirewallMode *string, newFirewallRuleset *string, newApplicationMode *string, newApplicationRuleset *string, newEnforcementPolicy *string) (resp bool, err error) {
449	params := []interface{}{
450		newIpsMode,
451		newIpsProtection,
452		newFirewallMode,
453		newFirewallRuleset,
454		newApplicationMode,
455		newApplicationRuleset,
456		newEnforcementPolicy,
457	}
458	err = r.Session.DoRequest("SoftLayer_Software_Component_HostIps", "updateHipsPolicies", params, &r.Options, &resp)
459	return
460}
461
462// This SoftLayer_Software_Component_Password data type contains a password for a specific software component instance.
463type Software_Component_Password struct {
464	Session *session.Session
465	Options sl.Options
466}
467
468// GetSoftwareComponentPasswordService returns an instance of the Software_Component_Password SoftLayer service
469func GetSoftwareComponentPasswordService(sess *session.Session) Software_Component_Password {
470	return Software_Component_Password{Session: sess}
471}
472
473func (r Software_Component_Password) Id(id int) Software_Component_Password {
474	r.Options.Id = &id
475	return r
476}
477
478func (r Software_Component_Password) Mask(mask string) Software_Component_Password {
479	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
480		mask = fmt.Sprintf("mask[%s]", mask)
481	}
482
483	r.Options.Mask = mask
484	return r
485}
486
487func (r Software_Component_Password) Filter(filter string) Software_Component_Password {
488	r.Options.Filter = filter
489	return r
490}
491
492func (r Software_Component_Password) Limit(limit int) Software_Component_Password {
493	r.Options.Limit = &limit
494	return r
495}
496
497func (r Software_Component_Password) Offset(offset int) Software_Component_Password {
498	r.Options.Offset = &offset
499	return r
500}
501
502// Create a password for a software component.
503func (r Software_Component_Password) CreateObject(templateObject *datatypes.Software_Component_Password) (resp datatypes.Software_Component_Password, err error) {
504	params := []interface{}{
505		templateObject,
506	}
507	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "createObject", params, &r.Options, &resp)
508	return
509}
510
511// Create more than one password for a software component.
512func (r Software_Component_Password) CreateObjects(templateObjects []datatypes.Software_Component_Password) (resp bool, err error) {
513	params := []interface{}{
514		templateObjects,
515	}
516	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "createObjects", params, &r.Options, &resp)
517	return
518}
519
520// Delete a password from a software component.
521func (r Software_Component_Password) DeleteObject() (resp bool, err error) {
522	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "deleteObject", nil, &r.Options, &resp)
523	return
524}
525
526// Delete more than one passwords from a software component.
527func (r Software_Component_Password) DeleteObjects(templateObjects []datatypes.Software_Component_Password) (resp bool, err error) {
528	params := []interface{}{
529		templateObjects,
530	}
531	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "deleteObjects", params, &r.Options, &resp)
532	return
533}
534
535// Edit the properties of a software component password such as the username, password, port, and notes.
536func (r Software_Component_Password) EditObject(templateObject *datatypes.Software_Component_Password) (resp bool, err error) {
537	params := []interface{}{
538		templateObject,
539	}
540	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "editObject", params, &r.Options, &resp)
541	return
542}
543
544// Edit more than one password from a software component.
545func (r Software_Component_Password) EditObjects(templateObjects []datatypes.Software_Component_Password) (resp bool, err error) {
546	params := []interface{}{
547		templateObjects,
548	}
549	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "editObjects", params, &r.Options, &resp)
550	return
551}
552
553// no documentation yet
554func (r Software_Component_Password) GetObject() (resp datatypes.Software_Component_Password, err error) {
555	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "getObject", nil, &r.Options, &resp)
556	return
557}
558
559// Retrieve The SoftLayer_Software_Component instance that this username/password pair is valid for.
560func (r Software_Component_Password) GetSoftware() (resp datatypes.Software_Component, err error) {
561	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "getSoftware", nil, &r.Options, &resp)
562	return
563}
564
565// Retrieve SSH keys to be installed on the server during provisioning or an OS reload.
566func (r Software_Component_Password) GetSshKeys() (resp []datatypes.Security_Ssh_Key, err error) {
567	err = r.Session.DoRequest("SoftLayer_Software_Component_Password", "getSshKeys", nil, &r.Options, &resp)
568	return
569}
570
571// This class holds a description for a specific installation of a Software Component.
572//
573// SoftLayer_Software_Licenses tie a Software Component (A specific installation on a piece of hardware) to it's description.
574//
575// The "Manufacturer" and "Name" properties of a SoftLayer_Software_Description are used by the framework to factory specific objects, objects that may have special methods for that specific piece of software, or objects that contain application specific data, such as default ports.  For example, if you create a SoftLayer_Software_Component who's SoftLayer_Software_License points to the SoftLayer_Software_Description for "Swsoft" "Plesk", you'll actually get a SoftLayer_Software_Component_Swsoft_Plesk object.
576type Software_Description struct {
577	Session *session.Session
578	Options sl.Options
579}
580
581// GetSoftwareDescriptionService returns an instance of the Software_Description SoftLayer service
582func GetSoftwareDescriptionService(sess *session.Session) Software_Description {
583	return Software_Description{Session: sess}
584}
585
586func (r Software_Description) Id(id int) Software_Description {
587	r.Options.Id = &id
588	return r
589}
590
591func (r Software_Description) Mask(mask string) Software_Description {
592	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
593		mask = fmt.Sprintf("mask[%s]", mask)
594	}
595
596	r.Options.Mask = mask
597	return r
598}
599
600func (r Software_Description) Filter(filter string) Software_Description {
601	r.Options.Filter = filter
602	return r
603}
604
605func (r Software_Description) Limit(limit int) Software_Description {
606	r.Options.Limit = &limit
607	return r
608}
609
610func (r Software_Description) Offset(offset int) Software_Description {
611	r.Options.Offset = &offset
612	return r
613}
614
615// no documentation yet
616func (r Software_Description) GetAllObjects() (resp []datatypes.Software_Description, err error) {
617	err = r.Session.DoRequest("SoftLayer_Software_Description", "getAllObjects", nil, &r.Options, &resp)
618	return
619}
620
621// Retrieve
622func (r Software_Description) GetAttributes() (resp []datatypes.Software_Description_Attribute, err error) {
623	err = r.Session.DoRequest("SoftLayer_Software_Description", "getAttributes", nil, &r.Options, &resp)
624	return
625}
626
627// Retrieve The average amount of time that a software description takes to install.
628func (r Software_Description) GetAverageInstallationDuration() (resp int, err error) {
629	err = r.Session.DoRequest("SoftLayer_Software_Description", "getAverageInstallationDuration", nil, &r.Options, &resp)
630	return
631}
632
633// Retrieve A list of the software descriptions that are compatible with this software description.
634func (r Software_Description) GetCompatibleSoftwareDescriptions() (resp []datatypes.Software_Description, err error) {
635	err = r.Session.DoRequest("SoftLayer_Software_Description", "getCompatibleSoftwareDescriptions", nil, &r.Options, &resp)
636	return
637}
638
639// no documentation yet
640func (r Software_Description) GetCustomerOwnedLicenseDescriptions() (resp []datatypes.Software_Description, err error) {
641	err = r.Session.DoRequest("SoftLayer_Software_Description", "getCustomerOwnedLicenseDescriptions", nil, &r.Options, &resp)
642	return
643}
644
645// Retrieve The feature attributes of a software description.
646func (r Software_Description) GetFeatures() (resp []datatypes.Software_Description_Feature, err error) {
647	err = r.Session.DoRequest("SoftLayer_Software_Description", "getFeatures", nil, &r.Options, &resp)
648	return
649}
650
651// Retrieve The latest version of a software description.
652func (r Software_Description) GetLatestVersion() (resp []datatypes.Software_Description, err error) {
653	err = r.Session.DoRequest("SoftLayer_Software_Description", "getLatestVersion", nil, &r.Options, &resp)
654	return
655}
656
657// no documentation yet
658func (r Software_Description) GetObject() (resp datatypes.Software_Description, err error) {
659	err = r.Session.DoRequest("SoftLayer_Software_Description", "getObject", nil, &r.Options, &resp)
660	return
661}
662
663// Retrieve The various product items to which this software description is linked.
664func (r Software_Description) GetProductItems() (resp []datatypes.Product_Item, err error) {
665	err = r.Session.DoRequest("SoftLayer_Software_Description", "getProductItems", nil, &r.Options, &resp)
666	return
667}
668
669// Retrieve This details the provisioning transaction group for this software. This is only valid for Operating System software.
670func (r Software_Description) GetProvisionTransactionGroup() (resp datatypes.Provisioning_Version1_Transaction_Group, err error) {
671	err = r.Session.DoRequest("SoftLayer_Software_Description", "getProvisionTransactionGroup", nil, &r.Options, &resp)
672	return
673}
674
675// Retrieve The transaction group that a software description belongs to. A transaction group is a sequence of transactions that must be performed in a specific order for the installation of software.
676func (r Software_Description) GetReloadTransactionGroup() (resp datatypes.Provisioning_Version1_Transaction_Group, err error) {
677	err = r.Session.DoRequest("SoftLayer_Software_Description", "getReloadTransactionGroup", nil, &r.Options, &resp)
678	return
679}
680
681// Retrieve The default user created for a given a software description.
682func (r Software_Description) GetRequiredUser() (resp string, err error) {
683	err = r.Session.DoRequest("SoftLayer_Software_Description", "getRequiredUser", nil, &r.Options, &resp)
684	return
685}
686
687// Retrieve Software Licenses that govern this Software Description.
688func (r Software_Description) GetSoftwareLicenses() (resp []datatypes.Software_License, err error) {
689	err = r.Session.DoRequest("SoftLayer_Software_Description", "getSoftwareLicenses", nil, &r.Options, &resp)
690	return
691}
692
693// Retrieve A suggestion for an upgrade path from this Software Description
694func (r Software_Description) GetUpgradeSoftwareDescription() (resp datatypes.Software_Description, err error) {
695	err = r.Session.DoRequest("SoftLayer_Software_Description", "getUpgradeSoftwareDescription", nil, &r.Options, &resp)
696	return
697}
698
699// Retrieve A suggestion for an upgrade path from this Software Description (Deprecated - Use upgradeSoftwareDescription)
700func (r Software_Description) GetUpgradeSwDesc() (resp datatypes.Software_Description, err error) {
701	err = r.Session.DoRequest("SoftLayer_Software_Description", "getUpgradeSwDesc", nil, &r.Options, &resp)
702	return
703}
704
705// Retrieve
706func (r Software_Description) GetValidFilesystemTypes() (resp []datatypes.Configuration_Storage_Filesystem_Type, err error) {
707	err = r.Session.DoRequest("SoftLayer_Software_Description", "getValidFilesystemTypes", nil, &r.Options, &resp)
708	return
709}
710
711// SoftLayer_Software_VirtualLicense is the application class that handles a special type of Software License.  Most software licenses are licensed to a specific hardware ID;  virtual licenses are designed for virtual machines and therefore are assigned to an IP Address.  Not all software packages can be "virtual licensed".
712type Software_VirtualLicense struct {
713	Session *session.Session
714	Options sl.Options
715}
716
717// GetSoftwareVirtualLicenseService returns an instance of the Software_VirtualLicense SoftLayer service
718func GetSoftwareVirtualLicenseService(sess *session.Session) Software_VirtualLicense {
719	return Software_VirtualLicense{Session: sess}
720}
721
722func (r Software_VirtualLicense) Id(id int) Software_VirtualLicense {
723	r.Options.Id = &id
724	return r
725}
726
727func (r Software_VirtualLicense) Mask(mask string) Software_VirtualLicense {
728	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
729		mask = fmt.Sprintf("mask[%s]", mask)
730	}
731
732	r.Options.Mask = mask
733	return r
734}
735
736func (r Software_VirtualLicense) Filter(filter string) Software_VirtualLicense {
737	r.Options.Filter = filter
738	return r
739}
740
741func (r Software_VirtualLicense) Limit(limit int) Software_VirtualLicense {
742	r.Options.Limit = &limit
743	return r
744}
745
746func (r Software_VirtualLicense) Offset(offset int) Software_VirtualLicense {
747	r.Options.Offset = &offset
748	return r
749}
750
751// Retrieve The customer account this Virtual License belongs to.
752func (r Software_VirtualLicense) GetAccount() (resp datatypes.Account, err error) {
753	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getAccount", nil, &r.Options, &resp)
754	return
755}
756
757// Retrieve The billing item for a software virtual license.
758func (r Software_VirtualLicense) GetBillingItem() (resp datatypes.Billing_Item, err error) {
759	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getBillingItem", nil, &r.Options, &resp)
760	return
761}
762
763// Retrieve The hardware record to which the software virtual license is assigned.
764func (r Software_VirtualLicense) GetHostHardware() (resp datatypes.Hardware_Server, err error) {
765	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getHostHardware", nil, &r.Options, &resp)
766	return
767}
768
769// Retrieve The IP Address record associated with a virtual license.
770func (r Software_VirtualLicense) GetIpAddressRecord() (resp datatypes.Network_Subnet_IpAddress, err error) {
771	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getIpAddressRecord", nil, &r.Options, &resp)
772	return
773}
774
775// Attempt to retrieve the file associated with a virtual license, if such a file exists.  If there is no file for this virtual license, calling this method will either throw an exception or return false.
776func (r Software_VirtualLicense) GetLicenseFile() (resp []byte, err error) {
777	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getLicenseFile", nil, &r.Options, &resp)
778	return
779}
780
781// getObject retrieves the SoftLayer_Software_VirtualLicense object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Software_VirtualLicense service. You can only retrieve Virtual Licenses assigned to your account number.
782func (r Software_VirtualLicense) GetObject() (resp datatypes.Software_VirtualLicense, err error) {
783	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getObject", nil, &r.Options, &resp)
784	return
785}
786
787// Retrieve The SoftLayer_Software_Description that this virtual license is for.
788func (r Software_VirtualLicense) GetSoftwareDescription() (resp datatypes.Software_Description, err error) {
789	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getSoftwareDescription", nil, &r.Options, &resp)
790	return
791}
792
793// Retrieve The subnet this Virtual License's IP address belongs to.
794func (r Software_VirtualLicense) GetSubnet() (resp datatypes.Network_Subnet, err error) {
795	err = r.Session.DoRequest("SoftLayer_Software_VirtualLicense", "getSubnet", nil, &r.Options, &resp)
796	return
797}
798