business.go raw
1 /**
2 * Copyright 2016-2024 IBM Corp.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5 * the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
8 * on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9 * See the License for the specific language governing permissions and limitations under the License.
10 */
11
12 // AUTOMATICALLY GENERATED CODE - DO NOT MODIFY
13
14 package services
15
16 import (
17 "fmt"
18 "strings"
19
20 "github.com/softlayer/softlayer-go/datatypes"
21 "github.com/softlayer/softlayer-go/session"
22 "github.com/softlayer/softlayer-go/sl"
23 )
24
25 // Contains business partner channel information
26 type Business_Partner_Channel struct {
27 Session session.SLSession
28 Options sl.Options
29 }
30
31 // GetBusinessPartnerChannelService returns an instance of the Business_Partner_Channel SoftLayer service
32 func GetBusinessPartnerChannelService(sess session.SLSession) Business_Partner_Channel {
33 return Business_Partner_Channel{Session: sess}
34 }
35
36 func (r Business_Partner_Channel) Id(id int) Business_Partner_Channel {
37 r.Options.Id = &id
38 return r
39 }
40
41 func (r Business_Partner_Channel) Mask(mask string) Business_Partner_Channel {
42 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
43 mask = fmt.Sprintf("mask[%s]", mask)
44 }
45
46 r.Options.Mask = mask
47 return r
48 }
49
50 func (r Business_Partner_Channel) Filter(filter string) Business_Partner_Channel {
51 r.Options.Filter = filter
52 return r
53 }
54
55 func (r Business_Partner_Channel) Limit(limit int) Business_Partner_Channel {
56 r.Options.Limit = &limit
57 return r
58 }
59
60 func (r Business_Partner_Channel) Offset(offset int) Business_Partner_Channel {
61 r.Options.Offset = &offset
62 return r
63 }
64
65 // no documentation yet
66 func (r Business_Partner_Channel) GetObject() (resp datatypes.Business_Partner_Channel, err error) {
67 err = r.Session.DoRequest("SoftLayer_Business_Partner_Channel", "getObject", nil, &r.Options, &resp)
68 return
69 }
70
71 // Contains business partner segment information
72 type Business_Partner_Segment struct {
73 Session session.SLSession
74 Options sl.Options
75 }
76
77 // GetBusinessPartnerSegmentService returns an instance of the Business_Partner_Segment SoftLayer service
78 func GetBusinessPartnerSegmentService(sess session.SLSession) Business_Partner_Segment {
79 return Business_Partner_Segment{Session: sess}
80 }
81
82 func (r Business_Partner_Segment) Id(id int) Business_Partner_Segment {
83 r.Options.Id = &id
84 return r
85 }
86
87 func (r Business_Partner_Segment) Mask(mask string) Business_Partner_Segment {
88 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
89 mask = fmt.Sprintf("mask[%s]", mask)
90 }
91
92 r.Options.Mask = mask
93 return r
94 }
95
96 func (r Business_Partner_Segment) Filter(filter string) Business_Partner_Segment {
97 r.Options.Filter = filter
98 return r
99 }
100
101 func (r Business_Partner_Segment) Limit(limit int) Business_Partner_Segment {
102 r.Options.Limit = &limit
103 return r
104 }
105
106 func (r Business_Partner_Segment) Offset(offset int) Business_Partner_Segment {
107 r.Options.Offset = &offset
108 return r
109 }
110
111 // no documentation yet
112 func (r Business_Partner_Segment) GetObject() (resp datatypes.Business_Partner_Segment, err error) {
113 err = r.Session.DoRequest("SoftLayer_Business_Partner_Segment", "getObject", nil, &r.Options, &resp)
114 return
115 }
116