// Create creates a new record.
491843
func (m *GormRoleMappingRepository) Create(ctx context.Context, u *RoleMapping) error {
	defer goa.MeasureSince([]string{"goa", "db", "role_mapping", "create"}, time.Now())
	if u.RoleMappingID == uuid.Nil {
		u.RoleMappingID = uuid.NewV4()
	}
	err := m.db.Create(u).Error
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"role_mapping_id": u.RoleMappingID,
			"err":             err,
		}, "unable to create the role mapping")
		return errs.WithStack(err)
	}
	log.Debug(ctx, map[string]interface{}{
		"role_mapping_id": u.RoleMappingID,
	}, "Role mapping created!")
	return nil
}
54706
func (c *FakeCronJobs) Create(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &v2alpha1.CronJob{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v2alpha1.CronJob), err
}
89279
func (c *Cacher) Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error {
	return c.storage.Create(ctx, key, obj, out, ttl)
}
702164
func (s *ServicesService) Create(service *Service) (*Service, *http.Response, error) {
	req, err := s.client.NewRequest("POST", "services", service)
	if err != nil {
		return nil, nil, err
	}

	sv := new(Service)
	resp, err := s.client.Do(req, sv)
	if err != nil {
		return nil, resp, err
	}

	return sv, resp, err
}
408039
func (s *DB) Create(value interface{}) *DB {
	scope := s.NewScope(value)
	return scope.callCallbacks(s.parent.callbacks.creates).db
}
1097315
func (co *Consolidator) Create(query string) (r *Result, created bool) {
	co.mu.Lock()
	defer co.mu.Unlock()
	if r, ok := co.queries[query]; ok {
		return r, false
	}
	r = &Result{consolidator: co, query: query}
	r.executing.Lock()
	co.queries[query] = r
	return r, true
}
286538
func (h *fs) Create(filename string) (io.WriteCloser, error) {
	return os.Create(filename)
}
708289
func (mr *MockClusterRoleBindingInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockClusterRoleBindingInterface)(nil).Create), arg0)
}
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)
}
1179170
func (instanceApi *InstanceApi) Create(instance Instance) (*Instance, error) {
	send, merr := json.Marshal(instance)
	if merr != nil {
		return nil, merr
	}
	body, err := instanceApi.entityService.Create(send, map[string]string{})
	if err != nil {
		return nil, err
	}
	return parseInstance(body), nil
}
455085
func (b *DynamoDBBackend) Create(ctx context.Context, item backend.Item) (*backend.Lease, error) {
	err := b.create(ctx, item, modeCreate)
	if trace.IsCompareFailed(err) {
		err = trace.AlreadyExists(err.Error())
	}
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return b.newLease(item), nil
}
21886
func (mr *MockNodeInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockNodeInterface)(nil).Create), arg0)
}
455004
func (m *Manager) Create(key *KeyStoreKey) error {
	err := m.getKeyStoreCollection().Insert(key)
	if mgo.IsDup(err) {
		return db.ErrDuplicate
	}
	return err
}
165253
func (c *FakeEvents) Create(event *v1beta1.Event) (result *v1beta1.Event, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &v1beta1.Event{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.Event), err
}
850857
func (idx *AddrIndex) Create(dbTx database.Tx) error {
	_, err := dbTx.Metadata().CreateBucket(addrIndexKey)
	return err
}
472767
func (c *examples) Create(example *v1.Example) (result *v1.Example, err error) {
	result = &v1.Example{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("examples").
		Body(example).
		Do().
		Into(result)
	return
}
466570
func (api *ArchiveAPI) Create(value *sacloud.Archive) (*sacloud.Archive, error) {
	return api.request(func(res *sacloud.Response) error {
		return api.create(api.createRequest(value), res)
	})
}