github.com/twilio/twilio-go@v1.20.1/rest/flex/v1/insights_quality_management_settings_answer_sets.go (about) 1 /* 2 * This code was generated by 3 * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 * 7 * Twilio - Flex 8 * This is the public Twilio REST API. 9 * 10 * NOTE: This class is auto generated by OpenAPI Generator. 11 * https://openapi-generator.tech 12 * Do not edit the class manually. 13 */ 14 15 package openapi 16 17 import ( 18 "encoding/json" 19 "net/url" 20 ) 21 22 // Optional parameters for the method 'FetchInsightsSettingsAnswersets' 23 type FetchInsightsSettingsAnswersetsParams struct { 24 // The Authorization HTTP request header 25 Authorization *string `json:"Authorization,omitempty"` 26 } 27 28 func (params *FetchInsightsSettingsAnswersetsParams) SetAuthorization(Authorization string) *FetchInsightsSettingsAnswersetsParams { 29 params.Authorization = &Authorization 30 return params 31 } 32 33 // To get the Answer Set Settings for an Account 34 func (c *ApiService) FetchInsightsSettingsAnswersets(params *FetchInsightsSettingsAnswersetsParams) (*FlexV1InsightsSettingsAnswersets, error) { 35 path := "/v1/Insights/QualityManagement/Settings/AnswerSets" 36 37 data := url.Values{} 38 headers := make(map[string]interface{}) 39 40 if params != nil && params.Authorization != nil { 41 headers["Authorization"] = *params.Authorization 42 } 43 resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) 44 if err != nil { 45 return nil, err 46 } 47 48 defer resp.Body.Close() 49 50 ps := &FlexV1InsightsSettingsAnswersets{} 51 if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { 52 return nil, err 53 } 54 55 return ps, err 56 }