// Create runs the create action.
340936
func (c *SpaceController) Create(ctx *app.CreateSpaceContext) error {
	currentIdentity, err := c.app.UserService().LoadContextIdentityIfNotBanned(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	// Create AuthZ resource for the space as part of soft migration from deprecated Keycloak AuthZ API to new OSIO AuthZ API
	err = c.app.SpaceService().CreateSpace(ctx, currentIdentity.ID, ctx.SpaceID.String())
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err":      err,
			"space_id": ctx.SpaceID,
		}, "unable to register resource for space or assign space admin role to space creator")
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	return ctx.OK(&app.SpaceResource{Data: &app.SpaceResourceData{
		ResourceID: ctx.SpaceID.String(),
	}})
}
508253
func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ *taskAPI.CreateTaskResponse, err error) {
	return nil, errdefs.ErrNotImplemented
}
1361526
func (c *FakeProjects) Create(projectResource *project.Project) (result *project.Project, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(projectsResource, projectResource), &project.Project{})
	if obj == nil {
		return nil, err
	}
	return obj.(*project.Project), err
}
893656
func (c *FakeExamples) Create(example *crv1.Example) (result *crv1.Example, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(examplesResource, c.ns, example), &crv1.Example{})

	if obj == nil {
		return nil, err
	}
	return obj.(*crv1.Example), err
}
267488
func (c *FakeFoos) Create(foo *v1alpha1.Foo) (result *v1alpha1.Foo, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(foosResource, c.ns, foo), &v1alpha1.Foo{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Foo), err
}
87848
func (c *workflows) Create(workflow *v1alpha1.Workflow) (result *v1alpha1.Workflow, err error) {
	result = &v1alpha1.Workflow{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("workflows").
		Body(workflow).
		Do().
		Into(result)
	return
}
317651
func (b *Browser) Create(_ string) (billy.File, error) {
	return nil, errors.New("browser cannot create files")
}
616731
func Create(c *middleware.Context) {
	if c.Req.Method == "POST" {
		bucket, e := models.BucketCreate(c.Query("title"))
		if e != nil {
			fmt.Println(e)
			c.Error(500, e.Error())
			return
		}
		c.Redirect("/buckets/" + fmt.Sprint(bucket.Id))
		return
	}
	c.HTML(200, "buckets/create")
}
1250172
func (m *Manager) Create(see *See) error {
	see.ID = bson.NewObjectId()
	err := m.collection.Insert(see)
	if mgo.IsDup(err) {
		return db.ErrDuplicate
	}
	return err
}
927495
func (c *FakeUsers) Create(userResource *user.User) (result *user.User, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(usersResource, userResource), &user.User{})
	if obj == nil {
		return nil, err
	}
	return obj.(*user.User), err
}
570325
func (s *UsergroupsService) Create(name string) *UsergroupsCreateCall {
	var call UsergroupsCreateCall
	call.service = s
	call.name = name
	return &call
}
716628
func (c *QueryController) Create(ctx *app.CreateQueryContext) error {
	currentUserIdentityID, err := login.ContextIdentity(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))
	}
	var q query.Query
	err = application.Transactional(c.db, func(appl application.Application) error {
		err = appl.Spaces().CheckExists(ctx, ctx.SpaceID)
		if err != nil {
			return err
		}
		q = query.Query{
			SpaceID: ctx.SpaceID,
			Fields:  ctx.Payload.Data.Attributes.Fields,
			Title:   strings.TrimSpace(ctx.Payload.Data.Attributes.Title),
			Creator: *currentUserIdentityID,
		}
		err = appl.Queries().Create(ctx, &q)
		return errs.WithStack(err)
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	res := &app.QuerySingle{
		Data: ConvertQuery(ctx.Request, q),
	}
	ctx.ResponseData.Header().Set("Location", rest.AbsoluteURL(ctx.Request, app.QueryHref(ctx.SpaceID, res.Data.ID)))
	return ctx.Created(res)
}
738002
func (c *FakeRoutes) Create(routeResource *route.Route) (result *route.Route, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(routesResource, c.ns, routeResource), &route.Route{})

	if obj == nil {
		return nil, err
	}
	return obj.(*route.Route), err
}
320894
func (c *FakeApplications) Create(application *v1alpha1.Application) (result *v1alpha1.Application, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(applicationsResource, c.ns, application), &v1alpha1.Application{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Application), err
}
664424
func Created(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusCreated, response)
}
1296938
func (c *cronJobs) Create(cronJob *v1beta1.CronJob) (result *v1beta1.CronJob, err error) {
	result = &v1beta1.CronJob{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("cronjobs").
		Body(cronJob).
		Do().
		Into(result)
	return
}
1066250
func (s *InstantiateREST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
	if err := rest.BeforeCreate(Strategy, ctx, obj); err != nil {
		return nil, err
	}
	if err := createValidation(obj); err != nil {
		return nil, err
	}

	request := obj.(*buildapi.BuildRequest)
	if request.TriggeredBy == nil {
		buildTriggerCauses := []buildapi.BuildTriggerCause{}
		request.TriggeredBy = append(buildTriggerCauses,
			buildapi.BuildTriggerCause{
				Message: buildapi.BuildTriggerCauseManualMsg,
			},
		)
	}
	return s.generator.InstantiateInternal(ctx, request)
}