//Shouldn't need "rest" in any of these methods. Adding it here for consistency right now.
14090
func restCheckForDevice(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	token := vars[ID] //referring to this as "token" for now since the source variable is double purposed

	//Check for name first since we're using that meaning by default.
	dev, err := dbClient.GetDeviceByName(token)
	if err != nil {
		if err != db.ErrNotFound {
			LoggingClient.Error(err.Error())
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		} else {
			LoggingClient.Debug(fmt.Sprintf("device %s %v", token, err))
		}
	}

	//If lookup by name failed, see if we were passed the ID
	if len(dev.Name) == 0 {
		if dev, err = dbClient.GetDeviceById(token); err != nil {
			LoggingClient.Error(err.Error())
			if err == db.ErrNotFound {
				http.Error(w, err.Error(), http.StatusNotFound)
			} else if err == db.ErrInvalidObjectId {
				http.Error(w, err.Error(), http.StatusBadRequest)
			} else {
				http.Error(w, err.Error(), http.StatusInternalServerError)
			}
			return
		}
	}

	w.Header().Set("Content-Type", "application/json")
	json.NewEncoder(w).Encode(dev)
}
1208258
func (s *UpdateMethodInput) SetRestApiId(v string) *UpdateMethodInput {
	s.RestApiId = &v
	return s
}
784268
func NewREST(optsGetter generic.RESTOptionsGetter, ttl uint64) *REST {
	resource := api.Resource("events")
	opts, err := optsGetter.GetRESTOptions(resource)
	if err != nil {
		panic(err) // TODO: Propagate error up
	}

	store := &genericregistry.Store{
		NewFunc:       func() runtime.Object { return &api.Event{} },
		NewListFunc:   func() runtime.Object { return &api.EventList{} },
		PredicateFunc: event.MatchEvent,
		TTLFunc: func(runtime.Object, uint64, bool) (uint64, error) {
			return ttl, nil
		},
		DefaultQualifiedResource: resource,

		CreateStrategy: event.Strategy,
		UpdateStrategy: event.Strategy,
		DeleteStrategy: event.Strategy,

		TableConvertor: printerstorage.TableConvertor{TableGenerator: printers.NewTableGenerator().With(printersinternal.AddHandlers)},
	}
	options := &generic.StoreOptions{RESTOptions: opts, AttrFunc: event.GetAttrs} // Pass in opts to use UndecoratedStorage
	if err := store.CompleteWithOptions(options); err != nil {
		panic(err) // TODO: Propagate error up
	}
	return &REST{store}
}
1208602
func (s *DeleteRequestValidatorInput) SetRestApiId(v string) *DeleteRequestValidatorInput {
	s.RestApiId = &v
	return s
}
263936
func (s *DeleteModelInput) SetRestApiId(v string) *DeleteModelInput {
	s.RestApiId = &v
	return s
}
514618
func (s *GetModelInput) SetRestApiId(v string) *GetModelInput {
	s.RestApiId = &v
	return s
}
831661
func (s *UpdateIntegrationResponseInput) SetRestApiId(v string) *UpdateIntegrationResponseInput {
	s.RestApiId = &v
	return s
}
1294535
func (s *TestInvokeMethodInput) SetRestApiId(v string) *TestInvokeMethodInput {
	s.RestApiId = &v
	return s
}
596221
func (s *PutMethodResponseInput) SetRestApiId(v string) *PutMethodResponseInput {
	s.RestApiId = &v
	return s
}
789771
func (s *GetResourceInput) SetRestApiId(v string) *GetResourceInput {
	s.RestApiId = &v
	return s
}
79426
func (s *UpdateStageInput) SetRestApiId(v string) *UpdateStageInput {
	s.RestApiId = &v
	return s
}
1236101
func (s *CreateResourceInput) SetRestApiId(v string) *CreateResourceInput {
	s.RestApiId = &v
	return s
}
603577
func (s *GetDocumentationPartsInput) SetRestApiId(v string) *GetDocumentationPartsInput {
	s.RestApiId = &v
	return s
}
1338405
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) {
	store := &registry.Store{
		NewFunc:                  func() runtime.Object { return &buildapi.BuildConfig{} },
		NewListFunc:              func() runtime.Object { return &buildapi.BuildConfigList{} },
		DefaultQualifiedResource: build.Resource("buildconfigs"),

		TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},

		CreateStrategy: buildconfig.GroupStrategy,
		UpdateStrategy: buildconfig.GroupStrategy,
		DeleteStrategy: buildconfig.GroupStrategy,
	}

	options := &generic.StoreOptions{RESTOptions: optsGetter}
	if err := store.CompleteWithOptions(options); err != nil {
		return nil, err
	}

	return &REST{store}, nil
}
491238
func (s *DeleteIntegrationInput) SetRestApiId(v string) *DeleteIntegrationInput {
	s.RestApiId = &v
	return s
}
15027
func (s *UpdateDeploymentInput) SetRestApiId(v string) *UpdateDeploymentInput {
	s.RestApiId = &v
	return s
}
15137
func NewREST(imageRegistry image.Registry, imageStreamRegistry imagestream.Registry, registry registryhostname.RegistryHostnameRetriever) *REST {
	return &REST{
		imageRegistry:       imageRegistry,
		imageStreamRegistry: imageStreamRegistry,
		strategy:            NewStrategy(registry),
	}
}