github.com/twilio/twilio-go@v1.20.1/rest/messaging/v1/services_compliance_usa2p_usecases.go (about) 1 /* 2 * This code was generated by 3 * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 * 7 * Twilio - Messaging 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 "strings" 21 ) 22 23 // Optional parameters for the method 'FetchUsAppToPersonUsecase' 24 type FetchUsAppToPersonUsecaseParams struct { 25 // The unique string to identify the A2P brand. 26 BrandRegistrationSid *string `json:"BrandRegistrationSid,omitempty"` 27 } 28 29 func (params *FetchUsAppToPersonUsecaseParams) SetBrandRegistrationSid(BrandRegistrationSid string) *FetchUsAppToPersonUsecaseParams { 30 params.BrandRegistrationSid = &BrandRegistrationSid 31 return params 32 } 33 34 // 35 func (c *ApiService) FetchUsAppToPersonUsecase(MessagingServiceSid string, params *FetchUsAppToPersonUsecaseParams) (*MessagingV1UsAppToPersonUsecase, error) { 36 path := "/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/Usecases" 37 path = strings.Replace(path, "{"+"MessagingServiceSid"+"}", MessagingServiceSid, -1) 38 39 data := url.Values{} 40 headers := make(map[string]interface{}) 41 42 if params != nil && params.BrandRegistrationSid != nil { 43 data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) 44 } 45 46 resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) 47 if err != nil { 48 return nil, err 49 } 50 51 defer resp.Body.Close() 52 53 ps := &MessagingV1UsAppToPersonUsecase{} 54 if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { 55 return nil, err 56 } 57 58 return ps, err 59 }