// NewGetServiceID creates a new http.Handler for the get service ID operation
543745
func NewGetServiceID(ctx *middleware.Context, handler GetServiceIDHandler) *GetServiceID {
	return &GetServiceID{Context: ctx, Handler: handler}
}
886473
func getService(req *api.GenerateServiceRequest, id api.ServiceID) *api.Service {
	return req.Services[id]
}
616064
func (ep *EtcdClient) GetService(name string) ([]ServiceInfo, error) {
	keyName := "/contiv.io/service/" + name + "/"

	_, srvcList, err := ep.getServiceState(keyName)
	return srvcList, err
}
1052127
func NewGetCommand(device contract.Device, command contract.Command, context context.Context, httpCaller internal.HttpCaller) (Executor, error) {
	url := device.Service.Addressable.GetBaseURL() + strings.Replace(command.Get.Action.Path, DEVICEIDURLPARAM, device.Id, -1)
	request, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		return serviceCommand{}, err
	}

	correlationID := context.Value(clients.CorrelationHeader)
	if correlationID != nil {
		request.Header.Set(clients.CorrelationHeader, correlationID.(string))
	}

	return serviceCommand{
		Device:     device,
		HttpCaller: httpCaller,
		Request:    request,
	}, nil
}
1373299
func ParseServiceIDFrom(dn string) *ServiceID {
	// typical service name "cilium-etcd-client.kube-system.svc"
	idx1 := strings.IndexByte(dn, '.')
	if idx1 >= 0 {
		svc := ServiceID{
			Name: dn[:idx1],
		}
		idx2 := strings.IndexByte(dn[idx1+1:], '.')
		if idx2 >= 0 {
			// "cilium-etcd-client.kube-system.svc"
			//                     ^idx1+1    ^ idx1+1+idx2
			svc.Namespace = dn[idx1+1 : idx1+1+idx2]
		} else {
			// "cilium-etcd-client.kube-system"
			//                     ^idx1+1
			svc.Namespace = dn[idx1+1:]
		}
		return &svc
	}
	return nil
}
739979
func NewGetEndpointIDConfig(ctx *middleware.Context, handler GetEndpointIDConfigHandler) *GetEndpointIDConfig {
	return &GetEndpointIDConfig{Context: ctx, Handler: handler}
}
426904
func (_m *API) GetSnapshotsByServiceID(_a0 string) ([]dao.SnapshotInfo, error) {
	ret := _m.Called(_a0)

	var r0 []dao.SnapshotInfo
	if rf, ok := ret.Get(0).(func(string) []dao.SnapshotInfo); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]dao.SnapshotInfo)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1057221
func (p *PullRequest) GetID() int64 {
	if p == nil || p.ID == nil {
		return 0
	}
	return *p.ID
}
737518
func (api *ServicesAPI) Get(id string) (service *Service, err error) {
	res, err := api.client.restClient.Get(api.client.Endpoint+serviceUrl+id, api.client.options.TokenOptions)
	if err != nil {
		return
	}
	defer res.Body.Close()
	res, err = getError(res)
	if err != nil {
		return
	}
	var result Service
	err = json.NewDecoder(res.Body).Decode(&result)
	return &result, err
}
601873
func (c *ConsulBackend) serviceID() string {
	return fmt.Sprintf("%s:%s:%d", c.serviceName, c.redirectHost, c.redirectPort)
}
971671
func GetService(uuid string) (Service, error) {

	url := ""
	if string(uuid[0]) == "/" {
		url = uuid[8:]
	} else {
		url = "service/" + uuid + "/"
	}

	request := "GET"
	//Empty Body Request
	body := []byte(`{}`)
	var response Service

	data, err := TutumCall(url, request, body)
	if err != nil {
		return response, err
	}

	err = json.Unmarshal(data, &response)
	if err != nil {
		return response, err
	}

	return response, nil

}
1152025
func (p *PullRequestReview) GetID() int64 {
	if p == nil || p.ID == nil {
		return 0
	}
	return *p.ID
}
1191689
func NewGetEndpoint(ctx *middleware.Context, handler GetEndpointHandler) *GetEndpoint {
	return &GetEndpoint{Context: ctx, Handler: handler}
}
336624
func NewInstanceIDHandler(svcs <-chan types.StorageService) types.Middleware {
	iidh := &instanceIDHandler{
		s2d: map[string]string{},
	}
	for s := range svcs {
		iidh.s2d[strings.ToLower(s.Name())] = strings.ToLower(s.Driver().Name())
	}
	return iidh
}
435897
func (c *Client) GetServiceID(id int64) (*models.Service, error) {
	params := service.NewGetServiceIDParams().WithID(id).WithTimeout(api.ClientTimeout)
	resp, err := c.Service.GetServiceID(params)
	if err != nil {
		return nil, Hint(err)
	}
	return resp.Payload, nil
}
109339
func (m *marathonAdapter) GetService(id string) (*api.Service, *api.Error) {
	var apiErr *api.Error

	response, err := m.client.GetApp(sanitizeMarathonAppURL(id))
	if err != nil {
		apiErr = api.NewError(http.StatusNotFound, err.Error())
		return nil, apiErr
	}
	return m.conv.convertToService(response.App), apiErr
}
1059930
func (s *RegisterInstanceInput) SetServiceId(v string) *RegisterInstanceInput {
	s.ServiceId = &v
	return s
}