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_Layout_Container contains definitions for default page layouts 33type Layout_Container struct { 34 Session *session.Session 35 Options sl.Options 36} 37 38// GetLayoutContainerService returns an instance of the Layout_Container SoftLayer service 39func GetLayoutContainerService(sess *session.Session) Layout_Container { 40 return Layout_Container{Session: sess} 41} 42 43func (r Layout_Container) Id(id int) Layout_Container { 44 r.Options.Id = &id 45 return r 46} 47 48func (r Layout_Container) Mask(mask string) Layout_Container { 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 Layout_Container) Filter(filter string) Layout_Container { 58 r.Options.Filter = filter 59 return r 60} 61 62func (r Layout_Container) Limit(limit int) Layout_Container { 63 r.Options.Limit = &limit 64 return r 65} 66 67func (r Layout_Container) Offset(offset int) Layout_Container { 68 r.Options.Offset = &offset 69 return r 70} 71 72// Use this method to retrieve all active layout containers that can be customized. 73func (r Layout_Container) GetAllObjects() (resp []datatypes.Layout_Container, err error) { 74 err = r.Session.DoRequest("SoftLayer_Layout_Container", "getAllObjects", nil, &r.Options, &resp) 75 return 76} 77 78// Retrieve The type of the layout container object 79func (r Layout_Container) GetLayoutContainerType() (resp datatypes.Layout_Container_Type, err error) { 80 err = r.Session.DoRequest("SoftLayer_Layout_Container", "getLayoutContainerType", nil, &r.Options, &resp) 81 return 82} 83 84// Retrieve The layout items assigned to this layout container 85func (r Layout_Container) GetLayoutItems() (resp []datatypes.Layout_Item, err error) { 86 err = r.Session.DoRequest("SoftLayer_Layout_Container", "getLayoutItems", nil, &r.Options, &resp) 87 return 88} 89 90// no documentation yet 91func (r Layout_Container) GetObject() (resp datatypes.Layout_Container, err error) { 92 err = r.Session.DoRequest("SoftLayer_Layout_Container", "getObject", nil, &r.Options, &resp) 93 return 94} 95 96// The SoftLayer_Layout_Item contains definitions for default layout items 97type Layout_Item struct { 98 Session *session.Session 99 Options sl.Options 100} 101 102// GetLayoutItemService returns an instance of the Layout_Item SoftLayer service 103func GetLayoutItemService(sess *session.Session) Layout_Item { 104 return Layout_Item{Session: sess} 105} 106 107func (r Layout_Item) Id(id int) Layout_Item { 108 r.Options.Id = &id 109 return r 110} 111 112func (r Layout_Item) Mask(mask string) Layout_Item { 113 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 114 mask = fmt.Sprintf("mask[%s]", mask) 115 } 116 117 r.Options.Mask = mask 118 return r 119} 120 121func (r Layout_Item) Filter(filter string) Layout_Item { 122 r.Options.Filter = filter 123 return r 124} 125 126func (r Layout_Item) Limit(limit int) Layout_Item { 127 r.Options.Limit = &limit 128 return r 129} 130 131func (r Layout_Item) Offset(offset int) Layout_Item { 132 r.Options.Offset = &offset 133 return r 134} 135 136// Retrieve The layout preferences assigned to this layout item 137func (r Layout_Item) GetLayoutItemPreferences() (resp []datatypes.Layout_Preference, err error) { 138 err = r.Session.DoRequest("SoftLayer_Layout_Item", "getLayoutItemPreferences", nil, &r.Options, &resp) 139 return 140} 141 142// Retrieve The type of the layout item object 143func (r Layout_Item) GetLayoutItemType() (resp datatypes.Layout_Item_Type, err error) { 144 err = r.Session.DoRequest("SoftLayer_Layout_Item", "getLayoutItemType", nil, &r.Options, &resp) 145 return 146} 147 148// no documentation yet 149func (r Layout_Item) GetObject() (resp datatypes.Layout_Item, err error) { 150 err = r.Session.DoRequest("SoftLayer_Layout_Item", "getObject", nil, &r.Options, &resp) 151 return 152} 153 154// The SoftLayer_Layout_Profile contains the definition of the layout profile 155type Layout_Profile struct { 156 Session *session.Session 157 Options sl.Options 158} 159 160// GetLayoutProfileService returns an instance of the Layout_Profile SoftLayer service 161func GetLayoutProfileService(sess *session.Session) Layout_Profile { 162 return Layout_Profile{Session: sess} 163} 164 165func (r Layout_Profile) Id(id int) Layout_Profile { 166 r.Options.Id = &id 167 return r 168} 169 170func (r Layout_Profile) Mask(mask string) Layout_Profile { 171 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 172 mask = fmt.Sprintf("mask[%s]", mask) 173 } 174 175 r.Options.Mask = mask 176 return r 177} 178 179func (r Layout_Profile) Filter(filter string) Layout_Profile { 180 r.Options.Filter = filter 181 return r 182} 183 184func (r Layout_Profile) Limit(limit int) Layout_Profile { 185 r.Options.Limit = &limit 186 return r 187} 188 189func (r Layout_Profile) Offset(offset int) Layout_Profile { 190 r.Options.Offset = &offset 191 return r 192} 193 194// This method creates a new layout profile object. 195func (r Layout_Profile) CreateObject(templateObject *datatypes.Layout_Profile) (resp bool, err error) { 196 params := []interface{}{ 197 templateObject, 198 } 199 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "createObject", params, &r.Options, &resp) 200 return 201} 202 203// This method deletes an existing layout profile and associated custom preferences 204func (r Layout_Profile) DeleteObject() (resp bool, err error) { 205 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "deleteObject", nil, &r.Options, &resp) 206 return 207} 208 209// This method edits an existing layout profile object by passing in a modified instance of the object. 210func (r Layout_Profile) EditObject(templateObject *datatypes.Layout_Profile) (resp bool, err error) { 211 params := []interface{}{ 212 templateObject, 213 } 214 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "editObject", params, &r.Options, &resp) 215 return 216} 217 218// Retrieve 219func (r Layout_Profile) GetLayoutContainers() (resp []datatypes.Layout_Container, err error) { 220 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "getLayoutContainers", nil, &r.Options, &resp) 221 return 222} 223 224// Retrieve 225func (r Layout_Profile) GetLayoutPreferences() (resp []datatypes.Layout_Profile_Preference, err error) { 226 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "getLayoutPreferences", nil, &r.Options, &resp) 227 return 228} 229 230// no documentation yet 231func (r Layout_Profile) GetObject() (resp datatypes.Layout_Profile, err error) { 232 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "getObject", nil, &r.Options, &resp) 233 return 234} 235 236// This method modifies an existing associated [[SoftLayer_Layout_Profile_Preference]] object. If the preference object being modified is a default value object, a new record is created to override the default value. 237// 238// Only preferences that are assigned to a profile may be updated. Attempts to update a non-existent preference object will result in an exception being thrown. 239func (r Layout_Profile) ModifyPreference(templateObject *datatypes.Layout_Profile_Preference) (resp datatypes.Layout_Profile_Preference, err error) { 240 params := []interface{}{ 241 templateObject, 242 } 243 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "modifyPreference", params, &r.Options, &resp) 244 return 245} 246 247// Using this method, multiple [[SoftLayer_Layout_Profile_Preference]] objects may be updated at once. 248// 249// Refer to [[SoftLayer_Layout_Profile::modifyPreference()]] for more information. 250func (r Layout_Profile) ModifyPreferences(layoutPreferenceObjects []datatypes.Layout_Profile_Preference) (resp []datatypes.Layout_Profile_Preference, err error) { 251 params := []interface{}{ 252 layoutPreferenceObjects, 253 } 254 err = r.Session.DoRequest("SoftLayer_Layout_Profile", "modifyPreferences", params, &r.Options, &resp) 255 return 256} 257 258// no documentation yet 259type Layout_Profile_Containers struct { 260 Session *session.Session 261 Options sl.Options 262} 263 264// GetLayoutProfileContainersService returns an instance of the Layout_Profile_Containers SoftLayer service 265func GetLayoutProfileContainersService(sess *session.Session) Layout_Profile_Containers { 266 return Layout_Profile_Containers{Session: sess} 267} 268 269func (r Layout_Profile_Containers) Id(id int) Layout_Profile_Containers { 270 r.Options.Id = &id 271 return r 272} 273 274func (r Layout_Profile_Containers) Mask(mask string) Layout_Profile_Containers { 275 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 276 mask = fmt.Sprintf("mask[%s]", mask) 277 } 278 279 r.Options.Mask = mask 280 return r 281} 282 283func (r Layout_Profile_Containers) Filter(filter string) Layout_Profile_Containers { 284 r.Options.Filter = filter 285 return r 286} 287 288func (r Layout_Profile_Containers) Limit(limit int) Layout_Profile_Containers { 289 r.Options.Limit = &limit 290 return r 291} 292 293func (r Layout_Profile_Containers) Offset(offset int) Layout_Profile_Containers { 294 r.Options.Offset = &offset 295 return r 296} 297 298// no documentation yet 299func (r Layout_Profile_Containers) CreateObject(templateObject *datatypes.Layout_Profile_Containers) (resp bool, err error) { 300 params := []interface{}{ 301 templateObject, 302 } 303 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "createObject", params, &r.Options, &resp) 304 return 305} 306 307// no documentation yet 308func (r Layout_Profile_Containers) EditObject(templateObject *datatypes.Layout_Profile_Containers) (resp bool, err error) { 309 params := []interface{}{ 310 templateObject, 311 } 312 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "editObject", params, &r.Options, &resp) 313 return 314} 315 316// Retrieve The container to be contained 317func (r Layout_Profile_Containers) GetLayoutContainerType() (resp datatypes.Layout_Container, err error) { 318 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "getLayoutContainerType", nil, &r.Options, &resp) 319 return 320} 321 322// Retrieve The profile containing this container 323func (r Layout_Profile_Containers) GetLayoutProfile() (resp datatypes.Layout_Profile, err error) { 324 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "getLayoutProfile", nil, &r.Options, &resp) 325 return 326} 327 328// no documentation yet 329func (r Layout_Profile_Containers) GetObject() (resp datatypes.Layout_Profile_Containers, err error) { 330 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "getObject", nil, &r.Options, &resp) 331 return 332} 333 334// no documentation yet 335type Layout_Profile_Customer struct { 336 Session *session.Session 337 Options sl.Options 338} 339 340// GetLayoutProfileCustomerService returns an instance of the Layout_Profile_Customer SoftLayer service 341func GetLayoutProfileCustomerService(sess *session.Session) Layout_Profile_Customer { 342 return Layout_Profile_Customer{Session: sess} 343} 344 345func (r Layout_Profile_Customer) Id(id int) Layout_Profile_Customer { 346 r.Options.Id = &id 347 return r 348} 349 350func (r Layout_Profile_Customer) Mask(mask string) Layout_Profile_Customer { 351 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 352 mask = fmt.Sprintf("mask[%s]", mask) 353 } 354 355 r.Options.Mask = mask 356 return r 357} 358 359func (r Layout_Profile_Customer) Filter(filter string) Layout_Profile_Customer { 360 r.Options.Filter = filter 361 return r 362} 363 364func (r Layout_Profile_Customer) Limit(limit int) Layout_Profile_Customer { 365 r.Options.Limit = &limit 366 return r 367} 368 369func (r Layout_Profile_Customer) Offset(offset int) Layout_Profile_Customer { 370 r.Options.Offset = &offset 371 return r 372} 373 374// This method creates a new layout profile object. 375func (r Layout_Profile_Customer) CreateObject(templateObject *datatypes.Layout_Profile) (resp bool, err error) { 376 params := []interface{}{ 377 templateObject, 378 } 379 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "createObject", params, &r.Options, &resp) 380 return 381} 382 383// This method deletes an existing layout profile and associated custom preferences 384func (r Layout_Profile_Customer) DeleteObject() (resp bool, err error) { 385 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "deleteObject", nil, &r.Options, &resp) 386 return 387} 388 389// This method edits an existing layout profile object by passing in a modified instance of the object. 390func (r Layout_Profile_Customer) EditObject(templateObject *datatypes.Layout_Profile) (resp bool, err error) { 391 params := []interface{}{ 392 templateObject, 393 } 394 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "editObject", params, &r.Options, &resp) 395 return 396} 397 398// Retrieve 399func (r Layout_Profile_Customer) GetLayoutContainers() (resp []datatypes.Layout_Container, err error) { 400 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "getLayoutContainers", nil, &r.Options, &resp) 401 return 402} 403 404// Retrieve 405func (r Layout_Profile_Customer) GetLayoutPreferences() (resp []datatypes.Layout_Profile_Preference, err error) { 406 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "getLayoutPreferences", nil, &r.Options, &resp) 407 return 408} 409 410// no documentation yet 411func (r Layout_Profile_Customer) GetObject() (resp datatypes.Layout_Profile_Customer, err error) { 412 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "getObject", nil, &r.Options, &resp) 413 return 414} 415 416// Retrieve 417func (r Layout_Profile_Customer) GetUserRecord() (resp datatypes.User_Customer, err error) { 418 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "getUserRecord", nil, &r.Options, &resp) 419 return 420} 421 422// This method modifies an existing associated [[SoftLayer_Layout_Profile_Preference]] object. If the preference object being modified is a default value object, a new record is created to override the default value. 423// 424// Only preferences that are assigned to a profile may be updated. Attempts to update a non-existent preference object will result in an exception being thrown. 425func (r Layout_Profile_Customer) ModifyPreference(templateObject *datatypes.Layout_Profile_Preference) (resp datatypes.Layout_Profile_Preference, err error) { 426 params := []interface{}{ 427 templateObject, 428 } 429 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "modifyPreference", params, &r.Options, &resp) 430 return 431} 432 433// Using this method, multiple [[SoftLayer_Layout_Profile_Preference]] objects may be updated at once. 434// 435// Refer to [[SoftLayer_Layout_Profile::modifyPreference()]] for more information. 436func (r Layout_Profile_Customer) ModifyPreferences(layoutPreferenceObjects []datatypes.Layout_Profile_Preference) (resp []datatypes.Layout_Profile_Preference, err error) { 437 params := []interface{}{ 438 layoutPreferenceObjects, 439 } 440 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Customer", "modifyPreferences", params, &r.Options, &resp) 441 return 442} 443 444// The SoftLayer_Layout_Profile_Preference contains definitions for layout preferences 445type Layout_Profile_Preference struct { 446 Session *session.Session 447 Options sl.Options 448} 449 450// GetLayoutProfilePreferenceService returns an instance of the Layout_Profile_Preference SoftLayer service 451func GetLayoutProfilePreferenceService(sess *session.Session) Layout_Profile_Preference { 452 return Layout_Profile_Preference{Session: sess} 453} 454 455func (r Layout_Profile_Preference) Id(id int) Layout_Profile_Preference { 456 r.Options.Id = &id 457 return r 458} 459 460func (r Layout_Profile_Preference) Mask(mask string) Layout_Profile_Preference { 461 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 462 mask = fmt.Sprintf("mask[%s]", mask) 463 } 464 465 r.Options.Mask = mask 466 return r 467} 468 469func (r Layout_Profile_Preference) Filter(filter string) Layout_Profile_Preference { 470 r.Options.Filter = filter 471 return r 472} 473 474func (r Layout_Profile_Preference) Limit(limit int) Layout_Profile_Preference { 475 r.Options.Limit = &limit 476 return r 477} 478 479func (r Layout_Profile_Preference) Offset(offset int) Layout_Profile_Preference { 480 r.Options.Offset = &offset 481 return r 482} 483 484// Retrieve 485func (r Layout_Profile_Preference) GetLayoutContainer() (resp datatypes.Layout_Container, err error) { 486 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Preference", "getLayoutContainer", nil, &r.Options, &resp) 487 return 488} 489 490// Retrieve 491func (r Layout_Profile_Preference) GetLayoutItem() (resp datatypes.Layout_Item, err error) { 492 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Preference", "getLayoutItem", nil, &r.Options, &resp) 493 return 494} 495 496// Retrieve 497func (r Layout_Profile_Preference) GetLayoutPreference() (resp datatypes.Layout_Preference, err error) { 498 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Preference", "getLayoutPreference", nil, &r.Options, &resp) 499 return 500} 501 502// Retrieve 503func (r Layout_Profile_Preference) GetLayoutProfile() (resp datatypes.Layout_Profile, err error) { 504 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Preference", "getLayoutProfile", nil, &r.Options, &resp) 505 return 506} 507 508// no documentation yet 509func (r Layout_Profile_Preference) GetObject() (resp datatypes.Layout_Profile_Preference, err error) { 510 err = r.Session.DoRequest("SoftLayer_Layout_Profile_Preference", "getObject", nil, &r.Options, &resp) 511 return 512} 513