// Create a new Service for Twilio Proxy
Create a new Service for Twilio Proxy
// Create a new Service for Twilio Proxy
func (c *DefaultApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service, error) {
	path := "/v1/Services"
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.CallbackUrl != nil {
		data.Set("CallbackUrl", *params.CallbackUrl)
	}
	if params != nil && params.ChatInstanceSid != nil {
		data.Set("ChatInstanceSid", *params.ChatInstanceSid)
	}
	if params != nil && params.DefaultTtl != nil {
		data.Set("DefaultTtl", fmt.Sprint(*params.DefaultTtl))
	}
	if params != nil && params.GeoMatchLevel != nil {
		data.Set("GeoMatchLevel", *params.GeoMatchLevel)
	}
	if params != nil && params.InterceptCallbackUrl != nil {
		data.Set("InterceptCallbackUrl", *params.InterceptCallbackUrl)
	}
	if params != nil && params.NumberSelectionBehavior != nil {
		data.Set("NumberSelectionBehavior", *params.NumberSelectionBehavior)
	}
	if params != nil && params.OutOfSessionCallbackUrl != nil {
		data.Set("OutOfSessionCallbackUrl", *params.OutOfSessionCallbackUrl)
	}
	if params != nil && params.UniqueName != nil {
		data.Set("UniqueName", *params.UniqueName)
	}
	resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &ProxyV1Service{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func ( c * DefaultApiService ) CreateService ( params * CreateServiceParams ) ( * ProxyV1Service , error ) { path := " " data := url . Values { } headers := make ( map [ string ] interface { } ) if params != nil && params . CallbackUrl != nil { data . Set ( " " , * params . CallbackUrl ) } if params != nil && params . ChatInstanceSid != nil { data . Set ( " " , * params . ChatInstanceSid ) } if params != nil && params . DefaultTtl != nil { data . Set ( " " , fmt . Sprint ( * params . DefaultTtl ) ) } if params != nil && params . GeoMatchLevel != nil { data . Set ( " " , * params . GeoMatchLevel ) } if params != nil && params . InterceptCallbackUrl != nil { data . Set ( " " , * params . InterceptCallbackUrl ) } if params != nil && params . NumberSelectionBehavior != nil { data . Set ( " " , * params . NumberSelectionBehavior ) } if params != nil && params . OutOfSessionCallbackUrl != nil { data . Set ( " " , * params . OutOfSessionCallbackUrl ) } if params != nil && params . UniqueName != nil { data . Set ( " " , * params . UniqueName ) } resp , err := c . requestHandler . Post ( c . baseURL + path , data , headers ) if err != nil { return nil , err } defer resp . Body . Close ( ) ps := & ProxyV1Service { } if err := json . NewDecoder ( resp . Body ) . Decode ( ps ) ; err != nil { return nil , err } return ps , err }
Create a new Service for Twilio Proxy
Create a new Service for Twilio Proxy