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// no documentation yet
33type Locale struct {
34	Session *session.Session
35	Options sl.Options
36}
37
38// GetLocaleService returns an instance of the Locale SoftLayer service
39func GetLocaleService(sess *session.Session) Locale {
40	return Locale{Session: sess}
41}
42
43func (r Locale) Id(id int) Locale {
44	r.Options.Id = &id
45	return r
46}
47
48func (r Locale) Mask(mask string) Locale {
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 Locale) Filter(filter string) Locale {
58	r.Options.Filter = filter
59	return r
60}
61
62func (r Locale) Limit(limit int) Locale {
63	r.Options.Limit = &limit
64	return r
65}
66
67func (r Locale) Offset(offset int) Locale {
68	r.Options.Offset = &offset
69	return r
70}
71
72// no documentation yet
73func (r Locale) GetClosestToLanguageTag(languageTag *string) (resp datatypes.Locale, err error) {
74	params := []interface{}{
75		languageTag,
76	}
77	err = r.Session.DoRequest("SoftLayer_Locale", "getClosestToLanguageTag", params, &r.Options, &resp)
78	return
79}
80
81// no documentation yet
82func (r Locale) GetObject() (resp datatypes.Locale, err error) {
83	err = r.Session.DoRequest("SoftLayer_Locale", "getObject", nil, &r.Options, &resp)
84	return
85}
86
87// no documentation yet
88type Locale_Country struct {
89	Session *session.Session
90	Options sl.Options
91}
92
93// GetLocaleCountryService returns an instance of the Locale_Country SoftLayer service
94func GetLocaleCountryService(sess *session.Session) Locale_Country {
95	return Locale_Country{Session: sess}
96}
97
98func (r Locale_Country) Id(id int) Locale_Country {
99	r.Options.Id = &id
100	return r
101}
102
103func (r Locale_Country) Mask(mask string) Locale_Country {
104	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
105		mask = fmt.Sprintf("mask[%s]", mask)
106	}
107
108	r.Options.Mask = mask
109	return r
110}
111
112func (r Locale_Country) Filter(filter string) Locale_Country {
113	r.Options.Filter = filter
114	return r
115}
116
117func (r Locale_Country) Limit(limit int) Locale_Country {
118	r.Options.Limit = &limit
119	return r
120}
121
122func (r Locale_Country) Offset(offset int) Locale_Country {
123	r.Options.Offset = &offset
124	return r
125}
126
127// This method is to get the collection of VAT country codes and VAT ID Regexes.
128func (r Locale_Country) GetAllVatCountryCodesAndVatIdRegexes() (resp []datatypes.Container_Collection_Locale_VatCountryCodeAndFormat, err error) {
129	err = r.Session.DoRequest("SoftLayer_Locale_Country", "getAllVatCountryCodesAndVatIdRegexes", nil, &r.Options, &resp)
130	return
131}
132
133// Use this method to retrieve a list of countries and locale information available to the current user.
134func (r Locale_Country) GetAvailableCountries() (resp []datatypes.Locale_Country, err error) {
135	err = r.Session.DoRequest("SoftLayer_Locale_Country", "getAvailableCountries", nil, &r.Options, &resp)
136	return
137}
138
139// Use this method to retrieve a list of countries and locale information such as country code and state/provinces.
140func (r Locale_Country) GetCountries() (resp []datatypes.Locale_Country, err error) {
141	err = r.Session.DoRequest("SoftLayer_Locale_Country", "getCountries", nil, &r.Options, &resp)
142	return
143}
144
145// no documentation yet
146func (r Locale_Country) GetCountriesAndStates(usFirstFlag *bool) (resp []datatypes.Container_Collection_Locale_CountryCode, err error) {
147	params := []interface{}{
148		usFirstFlag,
149	}
150	err = r.Session.DoRequest("SoftLayer_Locale_Country", "getCountriesAndStates", params, &r.Options, &resp)
151	return
152}
153
154// no documentation yet
155func (r Locale_Country) GetObject() (resp datatypes.Locale_Country, err error) {
156	err = r.Session.DoRequest("SoftLayer_Locale_Country", "getObject", nil, &r.Options, &resp)
157	return
158}
159
160// Retrieve States that belong to this country.
161func (r Locale_Country) GetStates() (resp []datatypes.Locale_StateProvince, err error) {
162	err = r.Session.DoRequest("SoftLayer_Locale_Country", "getStates", nil, &r.Options, &resp)
163	return
164}
165
166// no documentation yet
167func (r Locale_Country) IsEuropeanUnionCountry(iso2CountryCode *string) (resp bool, err error) {
168	params := []interface{}{
169		iso2CountryCode,
170	}
171	err = r.Session.DoRequest("SoftLayer_Locale_Country", "isEuropeanUnionCountry", params, &r.Options, &resp)
172	return
173}
174
175// Each User is assigned a timezone allowing for a precise local timestamp.
176type Locale_Timezone struct {
177	Session *session.Session
178	Options sl.Options
179}
180
181// GetLocaleTimezoneService returns an instance of the Locale_Timezone SoftLayer service
182func GetLocaleTimezoneService(sess *session.Session) Locale_Timezone {
183	return Locale_Timezone{Session: sess}
184}
185
186func (r Locale_Timezone) Id(id int) Locale_Timezone {
187	r.Options.Id = &id
188	return r
189}
190
191func (r Locale_Timezone) Mask(mask string) Locale_Timezone {
192	if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
193		mask = fmt.Sprintf("mask[%s]", mask)
194	}
195
196	r.Options.Mask = mask
197	return r
198}
199
200func (r Locale_Timezone) Filter(filter string) Locale_Timezone {
201	r.Options.Filter = filter
202	return r
203}
204
205func (r Locale_Timezone) Limit(limit int) Locale_Timezone {
206	r.Options.Limit = &limit
207	return r
208}
209
210func (r Locale_Timezone) Offset(offset int) Locale_Timezone {
211	r.Options.Offset = &offset
212	return r
213}
214
215// Retrieve all timezone objects.
216func (r Locale_Timezone) GetAllObjects() (resp []datatypes.Locale_Timezone, err error) {
217	err = r.Session.DoRequest("SoftLayer_Locale_Timezone", "getAllObjects", nil, &r.Options, &resp)
218	return
219}
220
221// getObject retrieves the SoftLayer_Locale_Timezone object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Locale_Timezone service.
222func (r Locale_Timezone) GetObject() (resp datatypes.Locale_Timezone, err error) {
223	err = r.Session.DoRequest("SoftLayer_Locale_Timezone", "getObject", nil, &r.Options, &resp)
224	return
225}
226