compliance.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  // no documentation yet
  26  type Compliance_Report_Type struct {
  27  	Session session.SLSession
  28  	Options sl.Options
  29  }
  30  
  31  // GetComplianceReportTypeService returns an instance of the Compliance_Report_Type SoftLayer service
  32  func GetComplianceReportTypeService(sess session.SLSession) Compliance_Report_Type {
  33  	return Compliance_Report_Type{Session: sess}
  34  }
  35  
  36  func (r Compliance_Report_Type) Id(id int) Compliance_Report_Type {
  37  	r.Options.Id = &id
  38  	return r
  39  }
  40  
  41  func (r Compliance_Report_Type) Mask(mask string) Compliance_Report_Type {
  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 Compliance_Report_Type) Filter(filter string) Compliance_Report_Type {
  51  	r.Options.Filter = filter
  52  	return r
  53  }
  54  
  55  func (r Compliance_Report_Type) Limit(limit int) Compliance_Report_Type {
  56  	r.Options.Limit = &limit
  57  	return r
  58  }
  59  
  60  func (r Compliance_Report_Type) Offset(offset int) Compliance_Report_Type {
  61  	r.Options.Offset = &offset
  62  	return r
  63  }
  64  
  65  // no documentation yet
  66  func (r Compliance_Report_Type) GetAllObjects() (resp []datatypes.Compliance_Report_Type, err error) {
  67  	err = r.Session.DoRequest("SoftLayer_Compliance_Report_Type", "getAllObjects", nil, &r.Options, &resp)
  68  	return
  69  }
  70  
  71  // no documentation yet
  72  func (r Compliance_Report_Type) GetObject() (resp datatypes.Compliance_Report_Type, err error) {
  73  	err = r.Session.DoRequest("SoftLayer_Compliance_Report_Type", "getObject", nil, &r.Options, &resp)
  74  	return
  75  }
  76