// GetCall uses Twilio to get information about a voice call.
// See https://www.twilio.com/docs/voice/api/call
11443
func (twilio *Twilio) GetCall(sid string) (*VoiceResponse, *Exception, error) {
	var voiceResponse *VoiceResponse
	var exception *Exception
	twilioUrl := twilio.BaseUrl + "/Accounts/" + twilio.AccountSid + "/Calls/" + sid + ".json"

	res, err := twilio.get(twilioUrl)
	if err != nil {
		return nil, nil, err
	}
	defer res.Body.Close()

	responseBody, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return nil, nil, err
	}
	if res.StatusCode != http.StatusOK {
		exception = new(Exception)
		err = json.Unmarshal(responseBody, exception)
		return nil, exception, err
	}

	voiceResponse = new(VoiceResponse)
	err = json.Unmarshal(responseBody, voiceResponse)
	return voiceResponse, nil, err
}
526843
func (mr *MockContextMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockContext)(nil).Get), arg0, arg1)
}
269580
func WrapCall(w ...client.CallWrapper) Option {
	return func(o *Options) {
		o.Client.Init(client.WrapCall(w...))
	}
}
282930
func (s *Service) Get(componentsmachineproviderrpcmessagescatalogmachineretrievalrequest *ComponentsMachineProviderRpcMessagesCatalogMachineRetrievalRequest) *GetCall {
	c := &GetCall{s: s, urlParams_: make(gensupport.URLParams)}
	c.componentsmachineproviderrpcmessagescatalogmachineretrievalrequest = componentsmachineproviderrpcmessagescatalogmachineretrievalrequest
	return c
}
352221
func (self *_object) isCall() bool {
	switch fn := self.value.(type) {
	case _nativeFunctionObject:
		return fn.call != nil
	case _bindFunctionObject:
		return true
	case _nodeFunctionObject:
		return true
	}
	return false
}
539896
func (expr *Expr) IsCall() bool {
	_, ok := expr.Terms.([]*Term)
	return ok
}
500807
func (twilio *Twilio) CallWithUrlCallbacks(from, to string, callbackParameters *CallbackParameters) (*VoiceResponse, *Exception, error) {
	formValues := url.Values{}
	formValues.Set("From", from)
	formValues.Set("To", to)
	formValues.Set("Url", callbackParameters.Url)

	// Optional values
	if callbackParameters.Method != "" {
		formValues.Set("Method", callbackParameters.Method)
	}
	if callbackParameters.FallbackUrl != "" {
		formValues.Set("FallbackUrl", callbackParameters.FallbackUrl)
	}
	if callbackParameters.FallbackMethod != "" {
		formValues.Set("FallbackMethod", callbackParameters.FallbackMethod)
	}
	if callbackParameters.StatusCallback != "" {
		formValues.Set("StatusCallback", callbackParameters.StatusCallback)
	}
	if callbackParameters.StatusCallbackMethod != "" {
		formValues.Set("StatusCallbackMethod", callbackParameters.StatusCallbackMethod)
	}
	for _, event := range callbackParameters.StatusCallbackEvent {
		formValues.Add("StatusCallbackEvent", event)
	}
	if callbackParameters.SendDigits != "" {
		formValues.Set("SendDigits", callbackParameters.SendDigits)
	}
	if callbackParameters.IfMachine != "" {
		formValues.Set("IfMachine", callbackParameters.IfMachine)
	}
	if callbackParameters.Timeout != 0 {
		formValues.Set("Timeout", strconv.Itoa(callbackParameters.Timeout))
	}
	if callbackParameters.MachineDetection != "" {
		formValues.Set("MachineDetection", callbackParameters.MachineDetection)
	}
	if callbackParameters.MachineDetectionTimeout != 0 {
		formValues.Set(
			"MachineDetectionTimeout",
			strconv.Itoa(callbackParameters.MachineDetectionTimeout),
		)
	}

	if callbackParameters.Record {
		formValues.Set("Record", "true")

		if callbackParameters.RecordingChannels != "" {
			formValues.Set("RecordingChannels", callbackParameters.RecordingChannels)
		}
		if callbackParameters.RecordingStatusCallback != "" {
			formValues.Set("RecordingStatusCallback", callbackParameters.RecordingStatusCallback)
		}
		if callbackParameters.RecordingStatusCallbackMethod != "" {
			formValues.Set("RecordingStatusCallbackMethod", callbackParameters.RecordingStatusCallbackMethod)
		}
	} else {
		formValues.Set("Record", "false")
	}

	return twilio.voicePost(formValues)
}
327691
func getCallerInfo() string {
	var info string

	for i := 0; ; i++ {
		pc, file, line, ok := runtime.Caller(i)
		if !ok {
			break
		}

		// 定位以 _test.go 结尾的文件。
		basename := path.Base(file)
		if !strings.HasSuffix(basename, "_test.go") {
			continue
		}

		// 定位函数名为 Test 开头的行。
		// 为什么要定位到 TestXxx 函数，是因为考虑以下情况：
		//  func isOK(val interface{}, t *testing.T) {
		//      // do somthing
		//      assert.True(t, val)  // (1
		//  }
		//
		//  func TestOK(t *testing.T) {
		//      isOK("123", t)       // (2
		//      isOK(123, t)         // (3
		//  }
		// 以上这段代码，定位到 (2、(3 的位置比总是定位到 (1 的位置更直观！
		funcName := runtime.FuncForPC(pc).Name()
		index := strings.LastIndex(funcName, ".Test")
		if -1 == index {
			index = strings.LastIndex(funcName, ".Benchmark")
			if index == -1 {
				continue
			}
		}
		funcName = funcName[index+1:]

		// Go1.5 之后的匿名函数为 TestA.func1
		// 包含以下几种情况：
		// 调用函数内的匿名函数；
		// 采用 go func(){} 的形式调用函数内的匿名函数；
		// 采用 go func(){} 的形式调用外部函数；
		//
		// 但是无法处理 go xx() 的情况，该情况直接开启一个新的堆栈信息，无法定位当前函数中的调用位置。
		if index := strings.IndexByte(funcName, '.'); index > -1 {
			funcName = funcName[:index]
			info = funcName + "(" + basename + ":" + strconv.Itoa(line) + ")"
			continue
		}

		info = funcName + "(" + basename + ":" + strconv.Itoa(line) + ")"
		break
	}

	if info == "" {
		info = "<无法获取调用者信息>"
	}
	return info
}
1131075
func (cli *client) Call(ctx context.Context, call *scheduler.Call) (mesos.Response, error) {
	return cli.httpDo(ctx, call)
}
326071
func getInboundCall(ctx context.Context) (*InboundCall, bool) {
	call, ok := ctx.Value(inboundCallKey{}).(*InboundCall)
	return call, ok
}
499704
func (t *Team) GetURL() string {
	if t == nil || t.URL == nil {
		return ""
	}
	return *t.URL
}
359320
func (mock *HttpClientMock) GetCalls() []struct {
	URL string
} {
	var calls []struct {
		URL string
	}
	lockhttpClientMockGet.RLock()
	calls = mock.calls.Get
	lockhttpClientMockGet.RUnlock()
	return calls
}
824905
func (c *Client) Call(serviceMethod string, args, ret interface{}) error {
	return c.CallWithOptions(serviceMethod, args, ret)
}
665019
func findCaller() *CallerInfo {
	for i := 3; ; i++ {
		pc, filepath, line, ok := runtime.Caller(i)
		if !ok {
			return UnknownCallerInfo
		}
		parts := strings.Split(filepath, "/")
		dir := parts[len(parts)-2]
		file := parts[len(parts)-1]
		if (dir != thisPackageName) || (file != thisFileName) {
			funcName := runtime.FuncForPC(pc).Name()
			return &CallerInfo{
				PathName: filepath,
				FileName: file,
				LineNo:   uint32(line),
				FuncName: funcName,
			}
		}
	}
}
1191200
func (s *requestSender) MakeCall(ctx context.Context, res *[]byte, fwdError *error, appError *error) <-chan bool {
	done := make(chan bool, 1)
	go func() {
		defer close(done)

		peer := s.channel.Peers().GetOrAdd(s.destination)

		call, err := peer.BeginCall(ctx, s.service, s.endpoint, &tchannel.CallOptions{
			Format: s.format,
		})
		if err != nil {
			*fwdError = err
			done <- true
			return
		}

		var arg3 []byte
		headers := s.headers
		if s.format == tchannel.Thrift {
			if headers == nil {
				headers = []byte{0, 0}
			}
			_, arg3, _, err = raw.WriteArgs(call, headers, s.request)
		} else {
			var resp *tchannel.OutboundCallResponse
			_, arg3, resp, err = raw.WriteArgs(call, headers, s.request)

			// check if the response is an application level error
			if err == nil && resp.ApplicationError() {
				// parse the json from the application level error
				errResp := struct {
					Type    string `json:"type"`
					Message string `json:"message"`
				}{}

				err = json.Unmarshal(arg3, &errResp)

				// if parsing succeeded return the error as an application error
				if err == nil {
					*appError = errors.New(errResp.Message)
					done <- true
					return
				}
			}
		}
		if err != nil {
			*fwdError = err
			done <- true
			return
		}

		*res = arg3
		done <- true
	}()

	return done
}
73098
func (r *Reference) GetURL() string {
	if r == nil || r.URL == nil {
		return ""
	}
	return *r.URL
}
49299
func (t *TeamLDAPMapping) GetURL() string {
	if t == nil || t.URL == nil {
		return ""
	}
	return *t.URL
}