func NewClient(accountSid string, authToken string, httpClient *http.Client) *Client {

	if httpClient == nil {
		httpClient = &http.Client{Timeout: defaultTimeout}
	}
	restClient := rest.NewClient(accountSid, authToken, BaseURL)
	restClient.Client = httpClient
	restClient.UploadType = rest.FormURLEncoded
	restClient.ErrorParser = parseTwilioError

	c := &Client{Client: restClient, AccountSid: accountSid, AuthToken: authToken}
	c.APIVersion = APIVersion

	c.FullPath = func(pathPart string) string {
		return "/" + strings.Join([]string{c.APIVersion, "Accounts", c.AccountSid, pathPart + ".json"}, "/")
	}
	c.Monitor = NewMonitorClient(accountSid, authToken, httpClient)
	c.Pricing = NewPricingClient(accountSid, authToken, httpClient)

	c.Accounts = &AccountService{client: c}
	c.Applications = &ApplicationService{client: c}
	c.Calls = &CallService{client: c}
	c.Conferences = &ConferenceService{client: c}
	c.Keys = &KeyService{client: c}
	c.Media = &MediaService{client: c}
	c.Messages = &MessageService{client: c}
	c.OutgoingCallerIDs = &OutgoingCallerIDService{client: c}
	c.Queues = &QueueService{client: c}
	c.Recordings = &RecordingService{client: c}
	c.Transcriptions = &TranscriptionService{client: c}

	c.IncomingNumbers = &IncomingNumberService{
		NumberPurchasingService: &NumberPurchasingService{
			client:   c,
			pathPart: "",
		},
		client: c,
		Local: &NumberPurchasingService{
			client:   c,
			pathPart: "Local",
		},
		TollFree: &NumberPurchasingService{
			client:   c,
			pathPart: "TollFree",
		},
	}
	return c
}
func NewClient(accountSid string, authToken string, httpClient *http.Client) *Client {

	if httpClient == nil {
		httpClient = &http.Client{Timeout: defaultTimeout}
	}
	restClient := rest.NewClient(accountSid, authToken, BaseURL)
	restClient.Client = httpClient
	restClient.UploadType = rest.FormURLEncoded
	restClient.ErrorParser = parseTwilioError

	c := &Client{Client: restClient, AccountSid: accountSid, AuthToken: authToken}
	c.APIVersion = APIVersion

	c.FullPath = func(pathPart string) string {
		return "/" + strings.Join([]string{c.APIVersion, "Accounts", c.AccountSid, pathPart + ".json"}, "/")
	}
	c.Monitor = NewMonitorClient(accountSid, authToken, httpClient)
	c.Pricing = NewPricingClient(accountSid, authToken, httpClient)

	c.Accounts = &AccountService{client: c}
	c.Applications = &ApplicationService{client: c}
	c.Calls = &CallService{client: c}
	c.Conferences = &ConferenceService{client: c}
	c.Keys = &KeyService{client: c}
	c.Media = &MediaService{client: c}
	c.Messages = &MessageService{client: c}
	c.OutgoingCallerIDs = &OutgoingCallerIDService{client: c}
	c.Queues = &QueueService{client: c}
	c.Recordings = &RecordingService{client: c}
	c.Transcriptions = &TranscriptionService{client: c}

	c.IncomingNumbers = &IncomingNumberService{
		NumberPurchasingService: &NumberPurchasingService{
			client:   c,
			pathPart: "",
		},
		client: c,
		Local: &NumberPurchasingService{
			client:   c,
			pathPart: "Local",
		},
		TollFree: &NumberPurchasingService{
			client:   c,
			pathPart: "TollFree",
		},
	}
	return c
}
func NewClient ( accountSid string , authToken string , httpClient * http . Client ) * Client { if httpClient == nil { httpClient = & http . Client { Timeout : defaultTimeout } } restClient := rest . NewClient ( accountSid , authToken , BaseURL ) restClient . Client = httpClient restClient . UploadType = rest . FormURLEncoded restClient . ErrorParser = parseTwilioError c := & Client { Client : restClient , AccountSid : accountSid , AuthToken : authToken } c . APIVersion = APIVersion c . FullPath = func ( pathPart string ) string { return " " + strings . Join ( [ ] string { c . APIVersion , " " , c . AccountSid , pathPart + " " } , " " ) } c . Monitor = NewMonitorClient ( accountSid , authToken , httpClient ) c . Pricing = NewPricingClient ( accountSid , authToken , httpClient ) c . Accounts = & AccountService { client : c } c . Applications = & ApplicationService { client : c } c . Calls = & CallService { client : c } c . Conferences = & ConferenceService { client : c } c . Keys = & KeyService { client : c } c . Media = & MediaService { client : c } c . Messages = & MessageService { client : c } c . OutgoingCallerIDs = & OutgoingCallerIDService { client : c } c . Queues = & QueueService { client : c } c . Recordings = & RecordingService { client : c } c . Transcriptions = & TranscriptionService { client : c } c . IncomingNumbers = & IncomingNumberService { NumberPurchasingService : & NumberPurchasingService { client : c , pathPart : " " , } , client : c , Local : & NumberPurchasingService { client : c , pathPart : " " , } , TollFree : & NumberPurchasingService { client : c , pathPart : " " , } , } return c }
// NewClient creates a Client for interacting with the Twilio API. This is the
// main entrypoint for API interactions; view the methods on the subresources
// for more information.
NewClient creates a Client for interacting with the Twilio API . This is the main entrypoint for API interactions ; view the methods on the subresources for more information .