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_Event_Log data type contains an event detail occurred upon various SoftLayer resources. 33type Event_Log struct { 34 Session *session.Session 35 Options sl.Options 36} 37 38// GetEventLogService returns an instance of the Event_Log SoftLayer service 39func GetEventLogService(sess *session.Session) Event_Log { 40 return Event_Log{Session: sess} 41} 42 43func (r Event_Log) Id(id int) Event_Log { 44 r.Options.Id = &id 45 return r 46} 47 48func (r Event_Log) Mask(mask string) Event_Log { 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 Event_Log) Filter(filter string) Event_Log { 58 r.Options.Filter = filter 59 return r 60} 61 62func (r Event_Log) Limit(limit int) Event_Log { 63 r.Options.Limit = &limit 64 return r 65} 66 67func (r Event_Log) Offset(offset int) Event_Log { 68 r.Options.Offset = &offset 69 return r 70} 71 72// This all indexed event names. 73func (r Event_Log) GetAllEventNames(objectName *string) (resp []string, err error) { 74 params := []interface{}{ 75 objectName, 76 } 77 err = r.Session.DoRequest("SoftLayer_Event_Log", "getAllEventNames", params, &r.Options, &resp) 78 return 79} 80 81// This all indexed event object names. 82func (r Event_Log) GetAllEventObjectNames() (resp []string, err error) { 83 err = r.Session.DoRequest("SoftLayer_Event_Log", "getAllEventObjectNames", nil, &r.Options, &resp) 84 return 85} 86 87// no documentation yet 88func (r Event_Log) GetAllObjects() (resp []datatypes.Event_Log, err error) { 89 err = r.Session.DoRequest("SoftLayer_Event_Log", "getAllObjects", nil, &r.Options, &resp) 90 return 91} 92 93// no documentation yet 94func (r Event_Log) GetAllUserTypes() (resp []string, err error) { 95 err = r.Session.DoRequest("SoftLayer_Event_Log", "getAllUserTypes", nil, &r.Options, &resp) 96 return 97} 98 99// Retrieve 100func (r Event_Log) GetUser() (resp datatypes.User_Customer, err error) { 101 err = r.Session.DoRequest("SoftLayer_Event_Log", "getUser", nil, &r.Options, &resp) 102 return 103} 104