github.com/twilio/twilio-go@v1.20.1/rest/trusthub/v1/compliance_inquiries_tollfree_initialize.go (about) 1 /* 2 * This code was generated by 3 * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 * 7 * Twilio - Trusthub 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 'CreateComplianceTollfreeInquiry' 23 type CreateComplianceTollfreeInquiryParams struct { 24 // The Tollfree phone number to be verified 25 TollfreePhoneNumber *string `json:"TollfreePhoneNumber,omitempty"` 26 // The email address to receive the notification about the verification result. 27 NotificationEmail *string `json:"NotificationEmail,omitempty"` 28 // The name of the business or organization using the Tollfree number. 29 BusinessName *string `json:"BusinessName,omitempty"` 30 // The website of the business or organization using the Tollfree number. 31 BusinessWebsite *string `json:"BusinessWebsite,omitempty"` 32 // The category of the use case for the Tollfree Number. List as many are applicable.. 33 UseCaseCategories *[]string `json:"UseCaseCategories,omitempty"` 34 // Use this to further explain how messaging is used by the business or organization. 35 UseCaseSummary *string `json:"UseCaseSummary,omitempty"` 36 // An example of message content, i.e. a sample message. 37 ProductionMessageSample *string `json:"ProductionMessageSample,omitempty"` 38 // Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. 39 OptInImageUrls *[]string `json:"OptInImageUrls,omitempty"` 40 // 41 OptInType *string `json:"OptInType,omitempty"` 42 // Estimate monthly volume of messages from the Tollfree Number. 43 MessageVolume *string `json:"MessageVolume,omitempty"` 44 // The address of the business or organization using the Tollfree number. 45 BusinessStreetAddress *string `json:"BusinessStreetAddress,omitempty"` 46 // The address of the business or organization using the Tollfree number. 47 BusinessStreetAddress2 *string `json:"BusinessStreetAddress2,omitempty"` 48 // The city of the business or organization using the Tollfree number. 49 BusinessCity *string `json:"BusinessCity,omitempty"` 50 // The state/province/region of the business or organization using the Tollfree number. 51 BusinessStateProvinceRegion *string `json:"BusinessStateProvinceRegion,omitempty"` 52 // The postal code of the business or organization using the Tollfree number. 53 BusinessPostalCode *string `json:"BusinessPostalCode,omitempty"` 54 // The country of the business or organization using the Tollfree number. 55 BusinessCountry *string `json:"BusinessCountry,omitempty"` 56 // Additional information to be provided for verification. 57 AdditionalInformation *string `json:"AdditionalInformation,omitempty"` 58 // The first name of the contact for the business or organization using the Tollfree number. 59 BusinessContactFirstName *string `json:"BusinessContactFirstName,omitempty"` 60 // The last name of the contact for the business or organization using the Tollfree number. 61 BusinessContactLastName *string `json:"BusinessContactLastName,omitempty"` 62 // The email address of the contact for the business or organization using the Tollfree number. 63 BusinessContactEmail *string `json:"BusinessContactEmail,omitempty"` 64 // The phone number of the contact for the business or organization using the Tollfree number. 65 BusinessContactPhone *string `json:"BusinessContactPhone,omitempty"` 66 } 67 68 func (params *CreateComplianceTollfreeInquiryParams) SetTollfreePhoneNumber(TollfreePhoneNumber string) *CreateComplianceTollfreeInquiryParams { 69 params.TollfreePhoneNumber = &TollfreePhoneNumber 70 return params 71 } 72 func (params *CreateComplianceTollfreeInquiryParams) SetNotificationEmail(NotificationEmail string) *CreateComplianceTollfreeInquiryParams { 73 params.NotificationEmail = &NotificationEmail 74 return params 75 } 76 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessName(BusinessName string) *CreateComplianceTollfreeInquiryParams { 77 params.BusinessName = &BusinessName 78 return params 79 } 80 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessWebsite(BusinessWebsite string) *CreateComplianceTollfreeInquiryParams { 81 params.BusinessWebsite = &BusinessWebsite 82 return params 83 } 84 func (params *CreateComplianceTollfreeInquiryParams) SetUseCaseCategories(UseCaseCategories []string) *CreateComplianceTollfreeInquiryParams { 85 params.UseCaseCategories = &UseCaseCategories 86 return params 87 } 88 func (params *CreateComplianceTollfreeInquiryParams) SetUseCaseSummary(UseCaseSummary string) *CreateComplianceTollfreeInquiryParams { 89 params.UseCaseSummary = &UseCaseSummary 90 return params 91 } 92 func (params *CreateComplianceTollfreeInquiryParams) SetProductionMessageSample(ProductionMessageSample string) *CreateComplianceTollfreeInquiryParams { 93 params.ProductionMessageSample = &ProductionMessageSample 94 return params 95 } 96 func (params *CreateComplianceTollfreeInquiryParams) SetOptInImageUrls(OptInImageUrls []string) *CreateComplianceTollfreeInquiryParams { 97 params.OptInImageUrls = &OptInImageUrls 98 return params 99 } 100 func (params *CreateComplianceTollfreeInquiryParams) SetOptInType(OptInType string) *CreateComplianceTollfreeInquiryParams { 101 params.OptInType = &OptInType 102 return params 103 } 104 func (params *CreateComplianceTollfreeInquiryParams) SetMessageVolume(MessageVolume string) *CreateComplianceTollfreeInquiryParams { 105 params.MessageVolume = &MessageVolume 106 return params 107 } 108 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessStreetAddress(BusinessStreetAddress string) *CreateComplianceTollfreeInquiryParams { 109 params.BusinessStreetAddress = &BusinessStreetAddress 110 return params 111 } 112 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessStreetAddress2(BusinessStreetAddress2 string) *CreateComplianceTollfreeInquiryParams { 113 params.BusinessStreetAddress2 = &BusinessStreetAddress2 114 return params 115 } 116 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessCity(BusinessCity string) *CreateComplianceTollfreeInquiryParams { 117 params.BusinessCity = &BusinessCity 118 return params 119 } 120 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessStateProvinceRegion(BusinessStateProvinceRegion string) *CreateComplianceTollfreeInquiryParams { 121 params.BusinessStateProvinceRegion = &BusinessStateProvinceRegion 122 return params 123 } 124 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessPostalCode(BusinessPostalCode string) *CreateComplianceTollfreeInquiryParams { 125 params.BusinessPostalCode = &BusinessPostalCode 126 return params 127 } 128 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessCountry(BusinessCountry string) *CreateComplianceTollfreeInquiryParams { 129 params.BusinessCountry = &BusinessCountry 130 return params 131 } 132 func (params *CreateComplianceTollfreeInquiryParams) SetAdditionalInformation(AdditionalInformation string) *CreateComplianceTollfreeInquiryParams { 133 params.AdditionalInformation = &AdditionalInformation 134 return params 135 } 136 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessContactFirstName(BusinessContactFirstName string) *CreateComplianceTollfreeInquiryParams { 137 params.BusinessContactFirstName = &BusinessContactFirstName 138 return params 139 } 140 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessContactLastName(BusinessContactLastName string) *CreateComplianceTollfreeInquiryParams { 141 params.BusinessContactLastName = &BusinessContactLastName 142 return params 143 } 144 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessContactEmail(BusinessContactEmail string) *CreateComplianceTollfreeInquiryParams { 145 params.BusinessContactEmail = &BusinessContactEmail 146 return params 147 } 148 func (params *CreateComplianceTollfreeInquiryParams) SetBusinessContactPhone(BusinessContactPhone string) *CreateComplianceTollfreeInquiryParams { 149 params.BusinessContactPhone = &BusinessContactPhone 150 return params 151 } 152 153 // Create a new Compliance Tollfree Verification Inquiry for the authenticated account. This is necessary to start a new embedded session. 154 func (c *ApiService) CreateComplianceTollfreeInquiry(params *CreateComplianceTollfreeInquiryParams) (*TrusthubV1ComplianceTollfreeInquiry, error) { 155 path := "/v1/ComplianceInquiries/Tollfree/Initialize" 156 157 data := url.Values{} 158 headers := make(map[string]interface{}) 159 160 if params != nil && params.TollfreePhoneNumber != nil { 161 data.Set("TollfreePhoneNumber", *params.TollfreePhoneNumber) 162 } 163 if params != nil && params.NotificationEmail != nil { 164 data.Set("NotificationEmail", *params.NotificationEmail) 165 } 166 if params != nil && params.BusinessName != nil { 167 data.Set("BusinessName", *params.BusinessName) 168 } 169 if params != nil && params.BusinessWebsite != nil { 170 data.Set("BusinessWebsite", *params.BusinessWebsite) 171 } 172 if params != nil && params.UseCaseCategories != nil { 173 for _, item := range *params.UseCaseCategories { 174 data.Add("UseCaseCategories", item) 175 } 176 } 177 if params != nil && params.UseCaseSummary != nil { 178 data.Set("UseCaseSummary", *params.UseCaseSummary) 179 } 180 if params != nil && params.ProductionMessageSample != nil { 181 data.Set("ProductionMessageSample", *params.ProductionMessageSample) 182 } 183 if params != nil && params.OptInImageUrls != nil { 184 for _, item := range *params.OptInImageUrls { 185 data.Add("OptInImageUrls", item) 186 } 187 } 188 if params != nil && params.OptInType != nil { 189 data.Set("OptInType", *params.OptInType) 190 } 191 if params != nil && params.MessageVolume != nil { 192 data.Set("MessageVolume", *params.MessageVolume) 193 } 194 if params != nil && params.BusinessStreetAddress != nil { 195 data.Set("BusinessStreetAddress", *params.BusinessStreetAddress) 196 } 197 if params != nil && params.BusinessStreetAddress2 != nil { 198 data.Set("BusinessStreetAddress2", *params.BusinessStreetAddress2) 199 } 200 if params != nil && params.BusinessCity != nil { 201 data.Set("BusinessCity", *params.BusinessCity) 202 } 203 if params != nil && params.BusinessStateProvinceRegion != nil { 204 data.Set("BusinessStateProvinceRegion", *params.BusinessStateProvinceRegion) 205 } 206 if params != nil && params.BusinessPostalCode != nil { 207 data.Set("BusinessPostalCode", *params.BusinessPostalCode) 208 } 209 if params != nil && params.BusinessCountry != nil { 210 data.Set("BusinessCountry", *params.BusinessCountry) 211 } 212 if params != nil && params.AdditionalInformation != nil { 213 data.Set("AdditionalInformation", *params.AdditionalInformation) 214 } 215 if params != nil && params.BusinessContactFirstName != nil { 216 data.Set("BusinessContactFirstName", *params.BusinessContactFirstName) 217 } 218 if params != nil && params.BusinessContactLastName != nil { 219 data.Set("BusinessContactLastName", *params.BusinessContactLastName) 220 } 221 if params != nil && params.BusinessContactEmail != nil { 222 data.Set("BusinessContactEmail", *params.BusinessContactEmail) 223 } 224 if params != nil && params.BusinessContactPhone != nil { 225 data.Set("BusinessContactPhone", *params.BusinessContactPhone) 226 } 227 228 resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) 229 if err != nil { 230 return nil, err 231 } 232 233 defer resp.Body.Close() 234 235 ps := &TrusthubV1ComplianceTollfreeInquiry{} 236 if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { 237 return nil, err 238 } 239 240 return ps, err 241 }