// Create creates a new record.
509035
func (m *GormPrivilegeCacheRepository) Create(ctx context.Context, privilegeCache *PrivilegeCache) error {
	defer goa.MeasureSince([]string{"goa", "db", "privilege_cache", "create"}, time.Now())

	if privilegeCache.PrivilegeCacheID == uuid.Nil {
		privilegeCache.PrivilegeCacheID = uuid.NewV4()
	}

	err := m.db.Create(privilegeCache).Error
	if err != nil {
		if gormsupport.IsUniqueViolation(err, "privilege_cache_pkey") {
			return errors.NewDataConflictError(fmt.Sprintf("privilege cache with ID %s already exists",
				privilegeCache.PrivilegeCacheID))
		}

		log.Error(ctx, map[string]interface{}{
			"privilege_cache_id": privilegeCache.PrivilegeCacheID,
			"err":                err,
		}, "unable to create the privilege cache")
		return errs.WithStack(err)
	}

	log.Info(ctx, map[string]interface{}{
		"privilege_cache_id": privilegeCache.PrivilegeCacheID,
	}, "Privilege cache created!")
	return nil
}
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
}
1308984
func (db *sqlDB) Create(m Model, s interface{}) error {
	stmt, err := db.stmts.Stmt(m)
	if err != nil {
		return err
	}

	return db.editRecord(s, stmt.Create)
}
279287
func (el *EndpointsLock) Create(ler LeaderElectionRecord) error {
	recordBytes, err := json.Marshal(ler)
	if err != nil {
		return err
	}
	el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Create(&v1.Endpoints{
		ObjectMeta: metav1.ObjectMeta{
			Name:      el.EndpointsMeta.Name,
			Namespace: el.EndpointsMeta.Namespace,
			Annotations: map[string]string{
				LeaderElectionRecordAnnotationKey: string(recordBytes),
			},
		},
	})
	return err
}
1227003
func (s *Service) Create(ctx context.Context, m *platform.DBRPMapping) error {
	if err := m.Validate(); err != nil {
		return nil
	}
	existing, err := s.loadDBRPMapping(ctx, m.Cluster, m.Database, m.RetentionPolicy)
	if err != nil {
		if err == errDBRPMappingNotFound {
			return s.PutDBRPMapping(ctx, m)
		}
		return err
	}

	if !existing.Equal(m) {
		return errors.New("dbrp mapping already exists")
	}

	return s.PutDBRPMapping(ctx, m)
}
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)
}
708289
func (mr *MockClusterRoleBindingInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockClusterRoleBindingInterface)(nil).Create), arg0)
}
985081
func (mem *Memory) Create(key string, rls *rspb.Release) error {
	defer unlock(mem.wlock())

	if recs, ok := mem.cache[rls.Name]; ok {
		if err := recs.Add(newRecord(key, rls)); err != nil {
			return err
		}
		mem.cache[rls.Name] = recs
		return nil
	}
	mem.cache[rls.Name] = records{newRecord(key, rls)}
	return nil
}
472740
func (d *DataBagService) Create(databag *DataBag) (result *DataBagCreateResult, err error) {
	body, err := JSONReader(databag)
	if err != nil {
		return
	}

	err = d.client.magicRequestDecoder("POST", "data", body, &result)
	return
}
843190
func (c *Client) CreateRecord(domain *Domain, record *Record) error {
	url := fmt.Sprintf("%s/%d/%s", "/dns/managed", domain.ID, "records")

	resp, err := c.sendRequest(http.MethodPost, url, record)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	return nil
}
21886
func (mr *MockNodeInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockNodeInterface)(nil).Create), arg0)
}
979122
func (_m *SessionServiceServer) Create(_a0 context.Context, _a1 *session.SessionCreateRequest) (*session.SessionResponse, error) {
	ret := _m.Called(_a0, _a1)

	var r0 *session.SessionResponse
	if rf, ok := ret.Get(0).(func(context.Context, *session.SessionCreateRequest) *session.SessionResponse); ok {
		r0 = rf(_a0, _a1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*session.SessionResponse)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, *session.SessionCreateRequest) error); ok {
		r1 = rf(_a0, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
309075
func (mr *MockPersistentVolumeInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockPersistentVolumeInterface)(nil).Create), arg0)
}
215057
func (r *GormOauthStateReferenceRepository) Create(ctx context.Context, reference *OauthStateReference) (*OauthStateReference, error) {
	if reference.ID == uuid.Nil {
		reference.ID = uuid.NewV4()
	}

	tx := r.db.Create(reference)
	if err := tx.Error; err != nil {
		return nil, errors.NewInternalError(ctx, err)
	}

	log.Info(ctx, map[string]interface{}{
		"oauth_state_reference_id": reference.ID,
	}, "Oauth state reference created successfully")
	return reference, nil
}
1172291
func (a *API) Create(args params.BackupsCreateArgs) (params.BackupsMetadataResult, error) {
	args.KeepCopy = true
	args.NoDownload = true

	apiv2 := APIv2{a}
	result, err := apiv2.Create(args)
	if err != nil {
		return result, errors.Trace(err)
	}
	return result, nil
}
562618
func (s *IndicesPutTemplateService) Create(create bool) *IndicesPutTemplateService {
	s.create = &create
	return s
}
1360212
func (mr *MockStorageClassInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockStorageClassInterface)(nil).Create), arg0)
}